Commit a97928ecb2716d8113fc6f4c3e05324be3cb700e
Merge branch 'master-liuyang' into 'master'
合并 See merge request !8
Showing
6 changed files
with
65 additions
and
18 deletions
atdd/__pycache__/ATDDCase.cpython-36.pyc
No preview for this file type
atdd/__pycache__/PcPost.cpython-36.pyc
No preview for this file type
tests/Staff-Management/MemberList/test_detail_mem.py
0 → 100644
1 | +import unittest | |
2 | +from atdd.PcPost import PcPost | |
3 | + | |
4 | + | |
5 | +class MemDetail(PcPost): | |
6 | + def setUp(self): | |
7 | + self.do_login(self.host, self.mobile, self.psw, self.domain) | |
8 | + | |
9 | + # 返回新增员工字段信息接口 | |
10 | + def test_memdetail(self): | |
11 | + url = '/contact/Apicp/User/AttributeInfo' | |
12 | + data = { | |
13 | + } | |
14 | + result = self.PcPost(url, data) | |
15 | + print('接口地址:' + self.host + self.domain + url) | |
16 | + self.assertEqual('ok', result['errmsg'], msg=result['errmsg']) # limit判断? 判断通过打印? | |
17 | + # print(result) | |
18 | + | |
19 | +if __name__ == '__main__': | |
20 | + unittest.main() | ... | ... |
tests/Staff-Management/MemberList/test_save_mem.py
0 → 100644
1 | +import unittest | |
2 | +from atdd.PcPost import PcPost | |
3 | + | |
4 | + | |
5 | +class SaveMem(PcPost): | |
6 | + def setUp(self): | |
7 | + self.do_login(self.host, self.mobile, self.psw, self.domain) | |
8 | + | |
9 | + def test_add_mem(self): | |
10 | + url = '/contact/Apicp/User/Save' | |
11 | + data = { | |
12 | + 'field_name': 'api-boy', | |
13 | + 'memGender': 2, | |
14 | + 'memMobile': '13818801801', | |
15 | + 'memEmail': '13818801801@163.com', | |
16 | + 'dpName': '755DDF7E0A69039F0BA121026E5D4D00', | |
17 | + 'memJob': '755DDF0C0A6916AB3CE15C27CE2D41BB', | |
18 | + 'memRole': '755DE1790A692CB94314A8BA1FEC458A' # 管理者 | |
19 | + } | |
20 | + result = self.PcPost(url, data) | |
21 | + print(self.host + '/' + self.domain + url) | |
22 | + print(result) | |
23 | + return result | |
24 | + | |
25 | +if __name__ == '__main__': | |
26 | + unittest.main() | ... | ... |
tests/Staff_Management/MemberList/test_memlist_mem.py
... | ... | @@ -8,11 +8,11 @@ class ReadMemList(PcPost): |
8 | 8 | self.do_login(self.host, self.mobile, self.psw, self.domain) |
9 | 9 | |
10 | 10 | def test_memlist(self): |
11 | - interfaceUrl = "/contact/Apicp/User/DepartmentMember" | |
11 | + url = "/contact/Apicp/User/DepartmentMember" | |
12 | 12 | data = { |
13 | 13 | } |
14 | - result = self.PcPost(interfaceUrl, data) | |
15 | - print(self.host + '/' + self.domain + interfaceUrl) | |
14 | + result = self.PcPost(url, data) | |
15 | + print(self.host + '/' + self.domain + url) | |
16 | 16 | self.assertEqual("ok", result["errmsg"], msg=result["errmsg"]) # 怎样断言返回结果中的limit(动态)数据? |
17 | - # print(result) | |
17 | + print(result) | |
18 | 18 | return result | ... | ... |
tests/Staff_Management/MemberList/test_search_mem.py
... | ... | @@ -9,46 +9,47 @@ class SearchMem(PcPost): |
9 | 9 | |
10 | 10 | # 全部列表 |
11 | 11 | def test_search_mem(self): |
12 | - interfaceUrl = '/contact/Apicp/User/DepartmentMember' | |
12 | + url = '/contact/Apicp/User/DepartmentMember' | |
13 | 13 | data = { |
14 | 14 | } |
15 | - result = self.PcPost(interfaceUrl, data) | |
16 | - print('接口地址:' + self.host + '/' + self.domain + interfaceUrl) | |
15 | + result = self.PcPost(url, data) | |
16 | + print('接口地址:' + self.host + '/' + self.domain + url) | |
17 | 17 | # print(result) |
18 | 18 | return result |
19 | 19 | |
20 | 20 | # 按姓名搜索 |
21 | 21 | def test_search_name(self): |
22 | - interfaceUrl = '/contact/Apicp/User/DepartmentMember' | |
22 | + url = '/contact/Apicp/User/DepartmentMember' | |
23 | 23 | data = { |
24 | 24 | 'name': '刘洋' |
25 | 25 | } |
26 | - result = self.PcPost(interfaceUrl, data) | |
26 | + result = self.PcPost(url, data) | |
27 | 27 | type(result) |
28 | - print('接口地址: ' + self.host + '/' + self.domain + interfaceUrl) | |
28 | + print('接口地址: ' + self.host + '/' + self.domain + url) | |
29 | 29 | self.assertEqual(0, result['errcode'], msg=result['errcode']) |
30 | 30 | # self.assertEqual('ok', result['errsdkcode'], msg=result['errsdkcode']) # 怎样断言返回结果中的limit(动态)数据? |
31 | - # print(result) | |
32 | 31 | return result |
33 | 32 | |
33 | + # 按手机号搜索 | |
34 | 34 | def test_search_mobile(self): |
35 | - interfaceurl = '/contact/Apicp/User/DepartmentMember' | |
35 | + url = '/contact/Apicp/User/DepartmentMember' | |
36 | 36 | data = { |
37 | 37 | 'mobile': 13818801804 |
38 | 38 | } |
39 | - result = self.PcPost(interfaceurl, data) | |
40 | - print('接口地址:' + self.host + '/' + self.domain + interfaceurl) | |
39 | + result = self.PcPost(url, data) | |
40 | + print('接口地址:' + self.host + '/' + self.domain + url) | |
41 | 41 | self.assertEqual(0, result['errcode'], msg=result['errcode']) |
42 | 42 | return result |
43 | 43 | |
44 | + # 按角色搜索 | |
44 | 45 | def test_search_role(self): |
45 | - interfaceurl = '/contact/Apicp/User/DepartmentMember' | |
46 | + url = '/contact/Apicp/User/DepartmentMember' | |
46 | 47 | data = { |
47 | - 'role_ids[0]': '6B3BC32E0A692CB96B91BD6A4C2D06BB' # 需动态获取角色列表数据作为参数读取 | |
48 | + 'role_ids[0]': '755DE1EC0A69039F18591A299B47E6F3' # 需动态获取角色列表数据作为参数读取 | |
48 | 49 | } |
49 | - result = self.PcPost(interfaceurl, data) | |
50 | + result = self.PcPost(url, data) | |
50 | 51 | self.assertEqual(0, result['errcode'], msg=result['errcode']) |
51 | - print(result) | |
52 | + print(result) # 返回结果待验证? | |
52 | 53 | return result |
53 | 54 | |
54 | 55 | ... | ... |