Commit 368bbf230bcc073dac86d9f659f4039a92f024e5
Merge branch 'feature/liuyang'
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,11 +8,11 @@ class ReadMemList(PcPost): | ||
8 | self.do_login(self.host, self.mobile, self.psw, self.domain) | 8 | self.do_login(self.host, self.mobile, self.psw, self.domain) |
9 | 9 | ||
10 | def test_memlist(self): | 10 | def test_memlist(self): |
11 | - interfaceUrl = "/contact/Apicp/User/DepartmentMember" | 11 | + url = "/contact/Apicp/User/DepartmentMember" |
12 | data = { | 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 | self.assertEqual("ok", result["errmsg"], msg=result["errmsg"]) # 怎样断言返回结果中的limit(动态)数据? | 16 | self.assertEqual("ok", result["errmsg"], msg=result["errmsg"]) # 怎样断言返回结果中的limit(动态)数据? |
17 | - # print(result) | 17 | + print(result) |
18 | return result | 18 | return result |
tests/Staff_Management/MemberList/test_search_mem.py
@@ -9,46 +9,47 @@ class SearchMem(PcPost): | @@ -9,46 +9,47 @@ class SearchMem(PcPost): | ||
9 | 9 | ||
10 | # 全部列表 | 10 | # 全部列表 |
11 | def test_search_mem(self): | 11 | def test_search_mem(self): |
12 | - interfaceUrl = '/contact/Apicp/User/DepartmentMember' | 12 | + url = '/contact/Apicp/User/DepartmentMember' |
13 | data = { | 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 | # print(result) | 17 | # print(result) |
18 | return result | 18 | return result |
19 | 19 | ||
20 | # 按姓名搜索 | 20 | # 按姓名搜索 |
21 | def test_search_name(self): | 21 | def test_search_name(self): |
22 | - interfaceUrl = '/contact/Apicp/User/DepartmentMember' | 22 | + url = '/contact/Apicp/User/DepartmentMember' |
23 | data = { | 23 | data = { |
24 | 'name': '刘洋' | 24 | 'name': '刘洋' |
25 | } | 25 | } |
26 | - result = self.PcPost(interfaceUrl, data) | 26 | + result = self.PcPost(url, data) |
27 | type(result) | 27 | type(result) |
28 | - print('接口地址: ' + self.host + '/' + self.domain + interfaceUrl) | 28 | + print('接口地址: ' + self.host + '/' + self.domain + url) |
29 | self.assertEqual(0, result['errcode'], msg=result['errcode']) | 29 | self.assertEqual(0, result['errcode'], msg=result['errcode']) |
30 | # self.assertEqual('ok', result['errsdkcode'], msg=result['errsdkcode']) # 怎样断言返回结果中的limit(动态)数据? | 30 | # self.assertEqual('ok', result['errsdkcode'], msg=result['errsdkcode']) # 怎样断言返回结果中的limit(动态)数据? |
31 | - # print(result) | ||
32 | return result | 31 | return result |
33 | 32 | ||
33 | + # 按手机号搜索 | ||
34 | def test_search_mobile(self): | 34 | def test_search_mobile(self): |
35 | - interfaceurl = '/contact/Apicp/User/DepartmentMember' | 35 | + url = '/contact/Apicp/User/DepartmentMember' |
36 | data = { | 36 | data = { |
37 | 'mobile': 13818801804 | 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 | self.assertEqual(0, result['errcode'], msg=result['errcode']) | 41 | self.assertEqual(0, result['errcode'], msg=result['errcode']) |
42 | return result | 42 | return result |
43 | 43 | ||
44 | + # 按角色搜索 | ||
44 | def test_search_role(self): | 45 | def test_search_role(self): |
45 | - interfaceurl = '/contact/Apicp/User/DepartmentMember' | 46 | + url = '/contact/Apicp/User/DepartmentMember' |
46 | data = { | 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 | self.assertEqual(0, result['errcode'], msg=result['errcode']) | 51 | self.assertEqual(0, result['errcode'], msg=result['errcode']) |
51 | - print(result) | 52 | + print(result) # 返回结果待验证? |
52 | return result | 53 | return result |
53 | 54 | ||
54 | 55 |