Commit 25980b3b700a45c2462ecf750037c9416c725277

Authored by 刘洋
1 parent b49bcddb

上传员工列表和搜索接口

atdd/__pycache__/ATDDCase.cpython-36.pyc 0 → 100644
No preview for this file type
atdd/__pycache__/PcPost.cpython-36.pyc 0 → 100644
No preview for this file type
tests/Staff-Management/MemberList/test_memlist_mem.py 0 → 100644
  1 +# Author: liuyang 2017年11月7日16:43:08
  2 +
  3 +from atdd.PcPost import PcPost
  4 +
  5 +
  6 +class ReadMemList(PcPost):
  7 + def setUp(self):
  8 + self.do_login(self.host, self.mobile, self.psw, self.domain)
  9 +
  10 + def test_memlist(self):
  11 + interfaceUrl = "/contact/Apicp/User/DepartmentMember"
  12 + data = {
  13 + }
  14 + result = self.PcPost(interfaceUrl, data)
  15 + print(self.host + '/' + self.domain + interfaceUrl)
  16 + self.assertEqual("ok", result["errmsg"], msg=result["errmsg"]) # 怎样断言返回结果中的limit(动态)数据?
  17 + # print(result)
  18 + return result
... ...
tests/Staff-Management/MemberList/test_search_mem.py 0 → 100644
  1 +import unittest
  2 +from atdd.PcPost import PcPost
  3 +
  4 +
  5 +class SearchMem(PcPost):
  6 +
  7 + def setUp(self):
  8 + self.do_login(self.host, self.mobile, self.psw, self.domain)
  9 +
  10 + # 全部列表
  11 + def test_search_mem(self):
  12 + interfaceUrl = '/contact/Apicp/User/DepartmentMember'
  13 + data = {
  14 + }
  15 + result = self.PcPost(interfaceUrl, data)
  16 + print('接口地址:' + self.host + '/' + self.domain + interfaceUrl)
  17 + # print(result)
  18 + return result
  19 +
  20 + # 按姓名搜索
  21 + def test_search_name(self):
  22 + interfaceUrl = '/contact/Apicp/User/DepartmentMember'
  23 + data = {
  24 + 'name': '刘洋'
  25 + }
  26 + result = self.PcPost(interfaceUrl, data)
  27 + type(result)
  28 + print('接口地址: ' + self.host + '/' + self.domain + interfaceUrl)
  29 + self.assertEqual(0, result['errcode'], msg=result['errcode'])
  30 + # self.assertEqual('ok', result['errsdkcode'], msg=result['errsdkcode']) # 怎样断言返回结果中的limit(动态)数据?
  31 + # print(result)
  32 + return result
  33 +
  34 + def test_search_mobile(self):
  35 + interfaceurl = '/contact/Apicp/User/DepartmentMember'
  36 + data = {
  37 + 'mobile': 13818801804
  38 + }
  39 + result = self.PcPost(interfaceurl, data)
  40 + print('接口地址:' + self.host + '/' + self.domain + interfaceurl)
  41 + self.assertEqual(0, result['errcode'], msg=result['errcode'])
  42 + return result
  43 +
  44 + def test_search_role(self):
  45 + interfaceurl = '/contact/Apicp/User/DepartmentMember'
  46 + data = {
  47 + 'role_ids[0]': '6B3BC32E0A692CB96B91BD6A4C2D06BB' # 需动态获取角色列表数据作为参数读取
  48 + }
  49 + result = self.PcPost(interfaceurl, data)
  50 + self.assertEqual(0, result['errcode'], msg=result['errcode'])
  51 + print(result)
  52 + return result
  53 +
  54 +
  55 +if __name__ == '__main__':
  56 + unittest.main()
... ...
tests/Staff-Management/Organization/test_search_org.py
... ... @@ -13,6 +13,7 @@ class SearchOrg(PcPost):
13 13 "keyword": 123
14 14 }
15 15 result = self.PcPost(interfaceUrl,data)
  16 + print(self.host + '/' + self.domain + interfaceUrl)
16 17 print(result)
17 18 return result
18 19  
... ...