UcPost.py
524 Bytes
from atdd.ATDDCase import ATDDCase
import json
class UcPost(ATDDCase):
def UcPost(self, interfaceUrl, data=None, **options):
self.interfaceUrl = interfaceUrl
self.data = data
app = "yuanquan"
url = self.uc_host + "/a/" + self.domain + '/' + app + interfaceUrl
r = self.post(url, self.data, **options)
self.assertEqual(200, r.status_code)
result = json.loads(r.text)
errcode = result['errcode']
self.assertEqual(0, errcode)
return result