Exemplo n.º 1
0
 def test_train_add(self, add_url, METHOD, DATA, CODE, CONTENT, expect):
     add_data = {
         'cus.tel': DATA['cus.tel'],
         'cus.name': DATA['cus.name'],
         'cus.sex': DATA['cus.sex'],
         'cus.last_status': DATA['cus.last_status'],
         'cus.email': DATA['cus.email'],
         'cus.qq': DATA['cus.qq'],
         'cus.school': DATA['cus.school'],
         'cus.education': DATA['cus.education'],
         'cus.major': DATA['cus.major'],
         'cus.intent': DATA['cus.intent'],
         'cus.workage': DATA['cus.workage'],
         'cus.salary': DATA['cus.salary'],
         'cus.source': DATA['cus.source'],
         'cus.applposition': DATA['cus.applposition'],
         'cus.age': DATA['cus.age'],
         'cus.eduexp': DATA['cus.eduexp'],
         'cus.experience': DATA['cus.experience'],
         'cus.last_tracking_remark': DATA['cus.last_tracking_remark']
     }
     resp = Training('..\\conf\\base.conf').do_add(add_url, add_data)
     if '新增成功' in resp.text:
         actual = 'add success'
     elif '该资源现属于测试账号名下,已更新该资源的信息.' in resp.text:
         actual = 'already added'
     else:
         actual = 'add fail'
     self.assertEqual(actual, expect)
Exemplo n.º 2
0
 def test_train_pubQuery(self, query_url, METHOD, DATA, CODE, CONTENT,
                         expect):
     query_data = {
         'pageSize': DATA['pageSize'],
         'pageIndex': DATA['pageIndex'],
         'workId': DATA['workId'],
         'lastStatus': DATA['lastStatus'],
         'source': DATA['source'],
         'cusInfo': DATA['cusInfo']
     }
     resp = Training('..\\conf\\base.conf').do_pubQuery(
         query_url, query_data)
     print(resp.text)
     num = resp.text.split(':')[1].split(',')
     if int(num[0]) != 0:
         if DATA['lastStatus'] == '无意向':
             counts = uiti.query_one(
                 '..\\conf\\base.conf',
                 'SELECT COUNT(customer_id) FROM customer WHERE last_status = "无意向"'
             )
             if counts[0] == int(num[0]):
                 actual = 'query ok'
             else:
                 actual = 'query fail'
         elif DATA['cusInfo'] == '姚茜':
             if int(num[0]) == 1:
                 actual = 'query ok'
             else:
                 actual = 'query fail'
     else:
         actual = 'query fail'
     self.assertEqual(actual, expect)
Exemplo n.º 3
0
 def test_train_edit(self, edit_url, METHOD, DATA, CODE, CONTENT, expect):
     edit_data = {
         'cus.customer_id': DATA['cus.customer_id'],
         'cus.name': DATA['cus.name'],
         'cus.sex': DATA['cus.sex'],
         'cus.last_status': DATA['cus.last_status'],
         'cus.tel': DATA['cus.tel'],
         'cus.email': DATA['cus.email'],
         'cus.qq': DATA['cus.qq'],
         'cus.school': DATA['cus.school'],
         'cus.education': DATA['cus.education'],
         'cus.major': DATA['cus.major'],
         'cus.intent': DATA['cus.intent'],
         'cus.workage': DATA['cus.workage'],
         'cus.age': DATA['cus.age'],
         'cus.source': DATA['cus.source'],
         'cus.applposition': DATA['cus.applposition'],
         'cus.eduexp': DATA['cus.eduexp'],
         'cus.experience': DATA['cus.experience'],
         'cus.last_tracking_remark': DATA['cus.last_tracking_remark']
     }
     resp = Training('..\\conf\\base.conf').do_edit(edit_url, edit_data)
     print(resp.text)
     if '修改成功' in resp.text:
         actual = 'edit success'
     else:
         actual = 'edit fail'
     self.assertEqual(actual, expect)
Exemplo n.º 4
0
 def test_train_owner(self, owner_url, METHOD, DATA, CODE, CONTENT, expect):
     owner_data = {'arr[]': DATA['arr[]']}
     resp = Training('..\\conf\\base.conf').do_owner(owner_url, owner_data)
     print(resp.text)
     if resp.text == '':
         actual = 'owner fail'
     else:
         actual = 'owner ok'
     self.assertEqual(actual, expect)
Exemplo n.º 5
0
 def test_train_see(self, see_url, METHOD, DATA, CODE, CONTENT, expect):
     see_data = {'cusId': DATA['cusId']}
     resp = Training('..\\conf\\base.conf').do_abandon(see_url, see_data)
     print(resp.text)
     if resp.text == '':
         actual = 'see fail'
     else:
         actual = 'see ok'
     self.assertEqual(actual, expect)
Exemplo n.º 6
0
 def test_train_see(self, commit_url, METHOD, DATA, CODE, CONTENT, expect):
     commit_data = {'arr[]': DATA['arr[]'], 'workId': DATA['workId']}
     resp = Training('..\\conf\\base.conf').do_abandon(
         commit_url, commit_data)
     print(resp.text)
     if resp.text == '':
         actual = 'commit fail'
     else:
         actual = 'commit ok'
     self.assertEqual(actual, expect)
Exemplo n.º 7
0
 def test_train_abandon(self, abandon_url, METHOD, DATA, CODE, CONTENT,
                        expect):
     abandon_data = {'arr[]': DATA['arr[]']}
     resp = Training('..\\conf\\base.conf').do_abandon(
         abandon_url, abandon_data)
     print(resp.text)
     if '废弃资源完成' in resp.text:
         actual = 'abandon success'
     else:
         actual = 'abandon fail'
     self.assertEqual(actual, expect)
Exemplo n.º 8
0
 def test_train_follow(self, follow_url, METHOD, DATA, CODE, CONTENT,
                       expect):
     follow_data = {
         'fee': DATA['fee'],
         'remark': DATA['remark'],
         'status': DATA['status'],
         'id': DATA['id'],
         'nextTime': DATA['nextTime'],
         'priority': DATA['priority']
     }
     resp = Training('..\\conf\\base.conf').do_follow(
         follow_url, follow_data)
     print(resp.text)
     if resp.text == '':
         actual = 'flow  fail'
     else:
         actual = 'flow ok'
     self.assertEqual(actual, expect)
Exemplo n.º 9
0
 def test_train_query(self, query_url, METHOD, DATA, CODE, CONTENT, expect):
     query_data = {
         'pageSize': DATA['pageSize'],
         'pageIndex': DATA['pageIndex'],
         'status': DATA['status'],
         'cusInfo': DATA['cusInfo'],
         'lastStatus': DATA['lastStatus'],
         'empName': DATA['empName'],
         'source': DATA['source'],
         's_time': DATA['s_time'],
         'e_time': DATA['e_time'],
         'poolType': DATA['poolType']
     }
     resp = Training('..\\conf\\base.conf').do_query(query_url, query_data)
     num = resp.text.split(':')[1].split(',')
     if int(num[0]) != 0:
         if DATA['poolType'] == 'temp':
             counts = uiti.query_one(
                 '..\\conf\\base.conf',
                 'SELECT COUNT(customer_id) FROM customer WHERE pool_type = "temp"'
             )
             if counts[0] == int(num[0]):
                 actual = 'query ok'
             else:
                 actual = 'query fail'
         elif DATA['lastStatus'] == '已报名':
             counts = uiti.query_one(
                 '..\\conf\\base.conf',
                 'SELECT COUNT(customer_id) FROM customer WHERE last_status = "已报名"'
             )
             if counts[0] == int(num[0]):
                 actual = 'query ok'
             else:
                 actual = 'query fail'
     else:
         actual = 'query fail'
     self.assertEqual(actual, expect)