test_update.py 1.41 KB

from atdd.ATDDCase import ATDDCase

# 手动变更用户积分
class Update(ATDDCase):

    def setUp(self):
        pass

    # 增加积分
    def test_update_add(self):
        header_json = {"Content-Type": "application/json; charset=utf-8"}
        url = self.uc_host + "/a/" + self.domain + "/" + self.app + "/qy/integral/update"
        data = {
            "milOptType": 2,
            "miType": "mi_type1",
            "integral": 1,
            "uids": self.jipeihong_uid,
            "remark": "测试",
            "milCreateMemUsername": "季培红",
            "milCreateMemUid": self.jipeihong_uid,
            "msgIdentifier": self.app
        }
        result = self.post(url, json=data, headers=header_json)
        print(url)
        print(result.json())

    # 扣减积分
    def test_update_detection(self):
        header_json = {"Content-Type": "application/json; charset=utf-8"}
        url = self.uc_host + "/a/" + self.domain + "/" + self.app + "/qy/integral/update"
        data = {
            "milOptType": 3,
            "miType": "mi_type0",
            "integral": 99999,
            "uids": self.jipeihong_uid,
            "remark": "测试",
            "milCreateMemUsername": "季培红",
            "milCreateMemUid": self.jipeihong_uid,
            "msgIdentifier": self.app
        }
        result = self.post(url, json=data, headers=header_json)
        print(url)
        print(result.json())