test_jobMode.py 1.14 KB
import unittest
from atdd.PcPost import PcPost


class JobMode(PcPost):
    url = '/Contact/Apicp/Setting/Update'

    def setUp(self):
        self.do_login(self.host, self.mobile, self.psw, self.domain)

    # 岗位设置-开启手动填写
    def test_input(self):
        data = {
            'jobMode': 'input'  # 手动填写
        }
        result = self.PcPost(self.url, data)
        print('接口地址:' + self.host + self.domain + self.url)
        self.assertEqual('ok', result['errmsg'], msg=result['errmsg'])
        requestId = result['requestId']  # 从返回结果中获取requestId值
        print('手动requestId = ' + requestId)
        return result

    # 岗位设置-开启配置选择
    def test_select(self):
        data = {
            'jobMode': 'select'  # 配置选择
        }
        result = self.PcPost(self.url, data)
        print('接口地址:' + self.host + self.domain + self.url)
        self.assertEqual('ok', result['errmsg'], msg=result['errmsg'])
        requestId = result['requestId']
        print('选择requestId = ' + requestId)
        return result


if __name__ == '__main__':
    unittest.main()