test_colleague_circle.py
3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import json
from atdd.ATDDCase import ATDDCase
from tests.Integral.publicMethods import PCpublicMethods
class ColleagueCircle(ATDDCase):
global list
url = ATDDCase().uc_host + '/a/' + ATDDCase().domain + '/' + ATDDCase().app + "/qy/integral/change"
businessKey = "colleague_circle"
triggerKeyDict = PCpublicMethods.PCpublicMethods().getTriggerKey(businessKey)
triggerValueDict = PCpublicMethods.PCpublicMethods().getTriggerValue(businessKey)
dictLimitConditions = PCpublicMethods.PCpublicMethods().getLimitConditions(businessKey)
def setUp(self):
pass
#同事圈-评论话题
def test_comment(self):
print(self.triggerKeyDict)
print(self.triggerValueDict)
data = {
"memUid": self.jipeihong_uid,
"businessKey": self.businessKey,
"businessAct": "comment",
"remark": "同事圈-评论话题",
"businessId": "551",
"triggerTypes": [
{
"triggerKey": "number", #次数(循环类型) 全局
"value": self.triggerValueDict['comment-number'][0]['condition']
},
{
"triggerKey": "comment_business_num", #评论个数(循环类型) 全局
"value": self.triggerValueDict['comment-comment_business_num'][0]['condition']
}]
}
result = self.post(self.url, json.dumps(data), headers=self.header_json)
code = result.json()['code']
print(result.json())
self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用
self.assertEquals(code,'SUCCESS')
self.assertEquals(result.json()['data'][0]['message'], '')
#同事圈-话题被评论
def test_was_comment(self):
data = {
"memUid": self.jipeihong_uid,
"businessKey": self.businessKey,
"businessAct": "was_comment",
"remark": "同事圈-话题被评论",
"businessId": "xx",
"triggerTypes": [
{
"triggerKey": "number", #次数(循环类型) 全局
"value": self.triggerValueDict['was_comment-number'][0]['condition']
},
{
"triggerKey": "was_comment_num", #评论个数(循环类型) 全局
"value": self.triggerValueDict['was_comment-was_comment_num'][0]['condition']
}
]
}
result = self.post(self.url, json.dumps(data), headers=self.header_json)
code = result.json()['code']
print(result.json())
self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用
self.assertEquals(code, 'SUCCESS')
self.assertEquals(result.json()['data'][0]['message'], '')
#同事圈-发表话题
def test_push(self):
print(self.triggerKeyDict)
data = {
"memUid": self.jipeihong_uid,
"businessKey": self.businessKey,
"businessAct": "push",
"remark": "同事圈-发表话题",
"businessId": "7",
"triggerTypes": [
{
"triggerKey": "number", #次数(循环类型) 全局
"value": self.triggerValueDict['push-number'][0]['condition']
}
]
}
result = self.post(self.url, json.dumps(data), headers=self.header_json)
code = result.json()['code']
print(result.json())
self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用
self.assertEquals(code, 'SUCCESS')
self.assertEquals(result.json()['data'][0]['message'], '')