def test_train_allot(self, allot_url, METHOD, DATA, CODE, CONTENT, expect): allot_data = { 'length': DATA['length'], 'work_id0': DATA['work_id0'], 'proportion0': DATA['proportion0'], 'work_id1': DATA['work_id1'], 'proportion1': DATA['proportion1'], 'work_id2': DATA['work_id2'], 'proportion2': DATA['proportion2'], 'work_id3': DATA['work_id3'], 'proportion3': DATA['proportion3'], 'work_id4': DATA['work_id4'], 'proportion4': DATA['proportion4'], 'work_id5': DATA['work_id5'], 'proportion5': DATA['proportion5'] } URL = 'http://192.168.101.135:8080/WoniuBoss2.5/log/userLogin' login_info = { 'userName': '******', 'userPass': '******', 'checkcode': '0000' } self.session = Service.get_session('..\\conf\\base.conf') login_resp = self.session.post(URL, login_info) resp = self.session.post(allot_url, allot_data) print(resp.text) if resp.text == '': actual = 'allot fail' else: actual = 'allot ok' self.assertEqual(actual, expect)
def __init__(self, base_path): self.session = Service.get_session(base_path) URL = 'http://192.168.101.135:8080/WoniuBoss2.5/log/userLogin' login_info = { 'userName': '******', 'userPass': '******', 'checkcode': '0000' } login_resp = self.session.post(URL, login_info)
def test_train_submit(self, submit_url, METHOD, DATA, CODE, CONTENT, expect): submit_data = {'arr[]': DATA['arr[]'], 'work_id': DATA['work_id']} URL = 'http://192.168.101.135:8080/WoniuBoss2.5/log/userLogin' login_info = { 'userName': '******', 'userPass': '******', 'checkcode': '0000' } self.session = Service.get_session('..\\conf\\base.conf') login_resp = self.session.post(URL, login_info) resp = self.session.post(submit_url, submit_data) print(resp.text) if resp.text == '': actual = 'submit fail' else: actual = 'submit ok' self.assertEqual(actual, expect)
def test_train_allQuery(self, allot_url, METHOD, DATA, CODE, CONTENT, expect): allot_data = { 'pageSize': DATA['pageSize'], 'pageIndex': DATA['pageIndex'], 'source': DATA['source'], 'info': DATA['info'] } URL = 'http://192.168.101.135:8080/WoniuBoss2.5/log/userLogin' login_info = { 'userName': '******', 'userPass': '******', 'checkcode': '0000' } self.session = Service.get_session('..\\conf\\base.conf') login_resp = self.session.post(URL, login_info) resp = self.session.post(allot_url, allot_data) num = resp.text.split(':')[1].split(',') if int(num[0]) == 1: actual = 'query ok' else: actual = 'query fail' self.assertEqual(actual, expect)
def __init__(self,base_path): self.session=Service.get_session(base_path)
def __init__(self, base_path): self.session = Service.get_session('..\\conf\\base.conf')