Commit 21fdf1510233c1e6d7aaedb926aa48944aa3e81f
Merge branch 'feature/jipeihong' into 'master'
Feature/jipeihong See merge request !2
Showing
7 changed files
with
127 additions
and
10 deletions
README.md
1 | +先去gitlab上创建开发分支:feature/自己的名字拼音 | |
2 | + | |
3 | +在本地项目中git输入命令: | |
4 | +git pull | |
5 | + | |
6 | +现在可以看到创建的开发分之,然后拉取开发分支 | |
7 | +git fetch origin feature/jipeihong:feature/jipeihong | |
8 | + | |
9 | +(运行git status, 切记要没有修改) | |
10 | + | |
11 | +切换到开发分支: | |
12 | +git checkout feature/jipeihong | |
13 | + | |
14 | +创建本地开发分支,对应gitlab开发分支: | |
15 | +git checkout topic/jipeihong | |
16 | + | |
17 | +然后进行rebase: | |
18 | +git rebase feature/jipeihong | |
19 | + | |
20 | +(然后就可以进行你的开发了) | |
21 | + | |
22 | +查看已经修改的东西 | |
23 | +git status | |
24 | + | |
25 | +确认好后进行提交 | |
26 | +git add . | |
27 | + | |
28 | +接着提交 | |
29 | +git commit -m '你的提交评论' | |
30 | + | |
31 | +然后推送到gitlab | |
32 | +git push origin topic/jipeihong:feature/jipeihong | |
33 | + | |
34 | +如果上面命令失败了,说明别人也同时有修改提交,需要你拉取下代码 | |
35 | +git fetch origin feature/jipeihong:feature/jipeihong | |
36 | + | |
37 | +git rebase feature/jipeihong | |
38 | + | |
39 | +rebase没问题就可以继续前面的git push命令了。 | |
40 | + | |
41 | +rebase有问题的话需要解决下冲突。 | |
0 | 42 | \ No newline at end of file | ... | ... |
atdd/ATDDCase.py
... | ... | @@ -14,12 +14,12 @@ class ATDDCase(unittest.TestCase): |
14 | 14 | global list |
15 | 15 | host = "https://yq.vchangyi.com" |
16 | 16 | uc_host = "http://l-rst.vchangyi.com" |
17 | - domain = '6B2A70EB0A6916AB0A71D556550EA970' | |
17 | + domain = '755DD9770A69039F18591A2906A3C371' # 企业号“小仙女” | |
18 | 18 | |
19 | 19 | |
20 | 20 | mobile = '17321009308' |
21 | 21 | psw = '123456' |
22 | - uid = '6B2A7F0F0A69039F559F4AA2A010BB26' | |
22 | + jipeihong_uid = '755DE0550A69039F0BA12102F4A4F8E1' # 季培红的UID | |
23 | 23 | cert = ('1_vchangyi.com_bundle.crt', '2_vchangyi.com.key') |
24 | 24 | |
25 | 25 | header_json = {"Content-Type": "application/json; charset=utf-8"} | ... | ... |
atdd/PcPost.py
... | ... | @@ -10,7 +10,7 @@ class PcPost(ATDDCase): |
10 | 10 | result = data['result'] |
11 | 11 | |
12 | 12 | if isinstance(result, list): |
13 | - user = result[0] | |
13 | + user = result[1] | |
14 | 14 | if len(result) > 1: |
15 | 15 | print("选择企业:", user['enterpriseInfo']['epName']) |
16 | 16 | |
... | ... | @@ -73,10 +73,10 @@ class PcPost(ATDDCase): |
73 | 73 | |
74 | 74 | url = self.host + '/' + self.domain + self.interfaceUrl |
75 | 75 | r = self.post(url, self.data, **options) |
76 | - self.assertEquals(200, r.status_code) | |
76 | + self.assertEqual(200, r.status_code) | |
77 | 77 | result = json.loads(r.text) |
78 | 78 | errcode = result['errcode'] |
79 | - self.assertEquals(0, errcode) | |
79 | + self.assertEqual(0, errcode) | |
80 | 80 | return result |
81 | 81 | |
82 | 82 | # 后端接口模板-异常判断 |
... | ... | @@ -87,8 +87,8 @@ class PcPost(ATDDCase): |
87 | 87 | |
88 | 88 | url = self.host + '/' + self.domain + self.interfaceUrl |
89 | 89 | r = self.post(url, self.data, **options) |
90 | - self.assertEquals(200, r.status_code) | |
90 | + self.assertEqual(200, r.status_code) | |
91 | 91 | result = json.loads(r.text) |
92 | 92 | errcode = result['errcode'] |
93 | - self.assertEquals(code, errcode) | |
93 | + self.assertEqual(code, errcode) | |
94 | 94 | return result |
95 | 95 | \ No newline at end of file | ... | ... |
tests/Staff-Management/Organization/public_org.py
0 → 100644
tests/Staff-Management/Organization/test_add_org.py
0 → 100644
1 | +# Author: jipeihong 2017年11月7日14:52:52 | |
2 | + | |
3 | +from atdd.PcPost import PcPost | |
4 | +import random | |
5 | + | |
6 | +class AddOrg(PcPost): | |
7 | + | |
8 | + | |
9 | + interfaceUrl = "/contact/Apicp/Department/Save" | |
10 | + | |
11 | + def setUp(self): | |
12 | + self.do_login(self.host, self.mobile, self.psw, self.domain) | |
13 | + | |
14 | + def get_top_org(self): | |
15 | + url = "/Contact/Apicp/Department/List" | |
16 | + data = { | |
17 | + "_identifier": 'contact', | |
18 | + "limit": 99999 | |
19 | + } | |
20 | + result = self.PcPost(url,data) | |
21 | + top_dpId = result['result']['list'][0]['dpId'] | |
22 | + return top_dpId | |
23 | + | |
24 | + | |
25 | + def test_add_org(self): | |
26 | + x = random.randint(0,1000) | |
27 | + top_dpId = self.get_top_org() | |
28 | + data = { | |
29 | + "department_id": None, | |
30 | + "parent_id": top_dpId, # 顶级部门 | |
31 | + "dp_name": "总部组织"+ str(x), | |
32 | + "is_all": 1, | |
33 | + "is_dept": 0, | |
34 | + "dpt_id": "755DD9820A69039F18591A29AC42531A", # 组织类型 | |
35 | + "dp_serial_num": 1, | |
36 | + "dp_leader_uids[0]": self.jipeihong_uid | |
37 | + } | |
38 | + result = self.PcPost(self.interfaceUrl,data) | |
39 | + print(result) | |
40 | + return result | |
0 | 41 | \ No newline at end of file | ... | ... |
tests/Staff-Management/Organization/test_delete_org.py
0 → 100644
1 | +# Author: jipeihong 2017年11月7日14:52:52 | |
2 | + | |
3 | +from atdd.PcPost import PcPost | |
4 | + | |
5 | +class DeleteOrg(PcPost): | |
6 | + | |
7 | + interfaceUrl = "/contact/Apicp/Department/Delete" | |
8 | + | |
9 | + def setUp(self): | |
10 | + self.do_login(self.host, self.mobile, self.psw, self.domain) | |
11 | + | |
12 | + # 查找除了顶级部门之外的所有部门的dpId | |
13 | + def get_all_dpId(self): | |
14 | + url = "/Contact/Apicp/Department/ListChildren" | |
15 | + data = { | |
16 | + "dpParentId": | |
17 | + } | |
18 | + | |
19 | + | |
20 | + def test_delete_org(self): | |
21 | + # data = { | |
22 | + # "department_id": | |
23 | + # } | ... | ... |
tests/Staff-Management/Organization/test_search_org.py
1 | 1 | |
2 | - # Author: jipeihong 2017年11月7日11:22:08 | |
2 | +# Author: jipeihong 2017年11月7日11:22:08 | |
3 | 3 | |
4 | 4 | from atdd.PcPost import PcPost |
5 | 5 | |
6 | +# 搜索组织 | |
6 | 7 | class SearchOrg(PcPost): |
8 | + | |
9 | + interfaceUrl = "/contact/Apicp/Department/Search" | |
10 | + | |
7 | 11 | def setUp(self): |
8 | 12 | self.do_login(self.host, self.mobile, self.psw, self.domain) |
9 | 13 | |
14 | + # 搜索存在的组织 | |
10 | 15 | def test_search_org(self): |
11 | - interfaceUrl = "/contact/Apicp/Department/Search" | |
12 | 16 | data = { |
13 | 17 | "keyword": 123 |
14 | 18 | } |
15 | - result = self.PcPost(interfaceUrl,data) | |
19 | + result = self.PcPost(self.interfaceUrl,data) | |
20 | + print(result) | |
21 | + return result | |
22 | + | |
23 | + # 搜索不存在的组织 | |
24 | + def test_search_org_abnormal(self): | |
25 | + data = { | |
26 | + "keyword": 12345 | |
27 | + } | |
28 | + result = self.PcPost(self.interfaceUrl,data) | |
16 | 29 | print(result) |
17 | 30 | return result |
18 | 31 | ... | ... |