smartpush 1.4.3__py3-none-any.whl → 1.4.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smartpush/flow/MockFlow.py +2 -2
- smartpush/test.py +37 -31
- smartpush/utils/ListDictUtils.py +3 -3
- {smartpush-1.4.3.dist-info → smartpush-1.4.4.dist-info}/METADATA +1 -1
- {smartpush-1.4.3.dist-info → smartpush-1.4.4.dist-info}/RECORD +7 -7
- {smartpush-1.4.3.dist-info → smartpush-1.4.4.dist-info}/WHEEL +0 -0
- {smartpush-1.4.3.dist-info → smartpush-1.4.4.dist-info}/top_level.txt +0 -0
smartpush/flow/MockFlow.py
CHANGED
@@ -27,7 +27,7 @@ def get_current_flow(host_domain, cookies, flow_id, splits=None, **kwargs):
|
|
27
27
|
|
28
28
|
def process_node(node, split_num=0, index_type="completedCount"):
|
29
29
|
# 如当前分支为拆分节点,根据走yes还是no分支取对应字段
|
30
|
-
if "split" == node["type"] and splits is not None:
|
30
|
+
if "split" == node["type"] and splits is not None and len(splits) > split_num:
|
31
31
|
index_type = "completedCount" if splits[split_num] == "true" else "skippedCount"
|
32
32
|
node_counts.append({node["id"]: {index_type: node["data"][index_type]
|
33
33
|
}
|
@@ -39,7 +39,7 @@ def get_current_flow(host_domain, cookies, flow_id, splits=None, **kwargs):
|
|
39
39
|
"sender": node["data"]["sendLetter"]["sender"],
|
40
40
|
}})
|
41
41
|
# 处理split节点
|
42
|
-
if "split" == node["type"] and splits is not None:
|
42
|
+
if "split" == node["type"] and splits is not None and len(splits) > split_num:
|
43
43
|
split_branch = node['data']['split']['branches'][splits[split_num]]
|
44
44
|
split_num += 1
|
45
45
|
for branch_node in split_branch:
|
smartpush/test.py
CHANGED
@@ -13,7 +13,7 @@ from smartpush.export.basic.ReadExcel import read_excel_and_write_to_dict
|
|
13
13
|
from smartpush.export.basic.GetOssUrl import get_oss_address_with_retry
|
14
14
|
from smartpush.utils.DataTypeUtils import DataTypeUtils
|
15
15
|
from smartpush.flow import MockFlow
|
16
|
-
from smartpush.utils import EmailUtlis
|
16
|
+
from smartpush.utils import EmailUtlis, ListDictUtils
|
17
17
|
|
18
18
|
if __name__ == '__main__':
|
19
19
|
# 导出流程
|
@@ -146,40 +146,46 @@ if __name__ == '__main__':
|
|
146
146
|
# split_node=["true"])
|
147
147
|
# print(mock_pulsar)
|
148
148
|
|
149
|
-
old_flow_counts, old_versions, email_contents = MockFlow.get_current_flow(host_domain=host_domain, cookies=cookies,
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
print(old_flow_counts, old_versions, email_contents)
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
#
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
149
|
+
# old_flow_counts, old_versions, email_contents = MockFlow.get_current_flow(host_domain=host_domain, cookies=cookies,
|
150
|
+
# flow_id="FLOW6966717528141252274",
|
151
|
+
# splits=["false", "true", "true"],
|
152
|
+
# get_email_content=True)
|
153
|
+
# print(old_flow_counts, old_versions, email_contents)
|
154
|
+
mock_pulsar_step1, _ = MockFlow.check_flow(mock_domain=_url, host_domain=host_domain, cookies=cookies,
|
155
|
+
flow_id="FLOW6966717528141252274", pulsar=params,
|
156
|
+
split_steps="one", split_node=["false", "true", "true"])
|
157
|
+
print(mock_pulsar_step1)
|
158
|
+
# time.sleep(60)
|
159
|
+
mock_pulsar_step2, email_contents = MockFlow.check_flow(mock_domain=_url, host_domain=host_domain, cookies=cookies,
|
160
|
+
flow_id="FLOW6966717528141252274",
|
161
|
+
old_flow_counts=mock_pulsar_step1,
|
162
|
+
split_steps="two", split_node=["false", "true", "true"],
|
163
|
+
get_email_content=True)
|
164
|
+
print(mock_pulsar_step2)
|
165
|
+
print(email_contents)
|
166
166
|
|
167
|
-
|
168
|
-
#
|
167
|
+
# split_steps="two")
|
168
|
+
# node_counts, versions = MockFlow.get_current_flow(host_domain=host_domain, cookies=cookies,
|
169
169
|
# flow_id="FLOW6749144046546626518")
|
170
170
|
|
171
171
|
# 调试
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
|
178
|
-
# b = [
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
172
|
+
# a = [{'049fd321-5a22-4f92-9692-a3da9507ee4b': {'completedCount': 44}},
|
173
|
+
# {'09ff19db-33a3-41d8-88e9-12e6017ddfd3': {'completedCount': 44}},
|
174
|
+
# {'31941d3a-910b-48fa-b302-0f3cf7790401': {'skippedCount': 7}},
|
175
|
+
# {'01e7c21d-ab57-4f89-98ad-1a437bca1138': {'completedCount': 5}},
|
176
|
+
# {'f3af15d5-848e-43d3-9ad3-d8f5172df6e0': {'completedCount': 5}},
|
177
|
+
# {'15630c25-75fa-4456-a6ee-a2bd1e3e64a1': {'completedCount': 42}}]
|
178
|
+
# b = [{'049fd321-5a22-4f92-9692-a3da9507ee4b': {'completedCount': 44}},
|
179
|
+
# {'09ff19db-33a3-41d8-88e9-12e6017ddfd3': {'completedCount': 44}},
|
180
|
+
# {'31941d3a-910b-48fa-b302-0f3cf7790401': {'skippedCount': 7}},
|
181
|
+
# {'01e7c21d-ab57-4f89-98ad-1a437bca1138': {'completedCount': 5}},
|
182
|
+
# {'f3af15d5-848e-43d3-9ad3-d8f5172df6e0': {'completedCount': 5}},
|
183
|
+
# {'15630c25-75fa-4456-a6ee-a2bd1e3e64a1': {'completedCount': 42}}]
|
184
|
+
# result = ListDictUtils.compare_lists(temp1=a,
|
185
|
+
# temp2=b, num=1,
|
186
|
+
# check_key=["completedCount", "skippedCount"],
|
187
|
+
# all_key=False)
|
188
|
+
# print(result)
|
183
189
|
|
184
190
|
# 断言邮件
|
185
191
|
loginEmail, password = 'lulu9600000@gmail.com', 'evvurakhttndwspx'
|
smartpush/utils/ListDictUtils.py
CHANGED
@@ -14,14 +14,14 @@ def compare_lists(temp1, temp2, check_key=["completedCount"], all_key=False, num
|
|
14
14
|
# 获取内层字典
|
15
15
|
inner_dict_a = temp1_a[outer_key]
|
16
16
|
inner_dict_b = temp2_b[outer_key]
|
17
|
+
# 提取内层字典key并存入list中
|
17
18
|
inner_dict_a_keys = list(inner_dict_a)
|
18
|
-
inner_dict_b_keys = list(inner_dict_b)
|
19
19
|
if all_key is False:
|
20
|
-
inner_dict_a_keys =
|
20
|
+
inner_dict_a_keys = check_key
|
21
21
|
# 遍历内层字典的键
|
22
22
|
for inner_key in inner_dict_a_keys:
|
23
23
|
# 确保 temp2 对应的内层字典中也有相同的键
|
24
|
-
if inner_key in
|
24
|
+
if inner_key in inner_dict_a.keys():
|
25
25
|
# 检查是否满足条件
|
26
26
|
if inner_dict_a[inner_key] + num != inner_dict_b[inner_key]:
|
27
27
|
error.append({
|
@@ -1,19 +1,19 @@
|
|
1
1
|
smartpush/__init__.py,sha256=XJrl1vhGATHSeSVqKmPXxYqxyseriUpvY5tLIXir3EE,24
|
2
2
|
smartpush/get_jira_info.py,sha256=Ej2JRlO_Kct6Koju57b27ySy_B4q43f0I2bFcS_fmaw,17801
|
3
|
-
smartpush/test.py,sha256=
|
3
|
+
smartpush/test.py,sha256=N2m5-MJvlKgTNk-kWq3eREzjBbirOiLJTMS9grVZu2Y,36723
|
4
4
|
smartpush/export/__init__.py,sha256=D9GbWcmwnetEndFDty5XbVienFK1WjqV2yYcQp3CM84,99
|
5
5
|
smartpush/export/basic/ExcelExportChecker.py,sha256=R_1gFy69vE2V5pY20zFsnhqWgJ42Vtf35zBtOPfhUpU,17590
|
6
6
|
smartpush/export/basic/GetOssUrl.py,sha256=LeF1y1_uJaYXth1KvO6mEDS29ezb9tliBv5SrbqYkXc,6136
|
7
7
|
smartpush/export/basic/ReadExcel.py,sha256=ZnG2mtYqLY-xuYx9SyulbdYUP_0E5jIeKDewfakAsTw,7342
|
8
8
|
smartpush/export/basic/__init__.py,sha256=6tcrS-2NSlsJo-UwEsnGUmwCf7jgOsh_UEbM0FD-gYE,70
|
9
|
-
smartpush/flow/MockFlow.py,sha256=
|
9
|
+
smartpush/flow/MockFlow.py,sha256=T8tZuJ9FLF0arbdu0PvbwXk-Ca-wjH46P-HCEW5aq2Y,8124
|
10
10
|
smartpush/flow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
smartpush/utils/DataTypeUtils.py,sha256=BC7ioztO3vAfKd1EOoNvXdVuXYY8qjNskV1DP7LhW-M,1082
|
12
12
|
smartpush/utils/EmailUtlis.py,sha256=DAHd73bJ8hiJCLEXtD0xcwxPD7SOPSmBB7Jvlf6gN6s,11201
|
13
|
-
smartpush/utils/ListDictUtils.py,sha256=
|
13
|
+
smartpush/utils/ListDictUtils.py,sha256=Fm5_d7UyY6xB8gySMPdl5jIFSRhXZcYXdYW-_L1alcE,1640
|
14
14
|
smartpush/utils/StringUtils.py,sha256=n8mo9k0JQN63MReImgv-66JxmmymOGknR8pH2fkQrAo,4139
|
15
15
|
smartpush/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
smartpush-1.4.
|
17
|
-
smartpush-1.4.
|
18
|
-
smartpush-1.4.
|
19
|
-
smartpush-1.4.
|
16
|
+
smartpush-1.4.4.dist-info/METADATA,sha256=y2Y8f7qQqrwC-a9JiZmj0TSUDODHSY6bLZXV4z0nnhA,131
|
17
|
+
smartpush-1.4.4.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
18
|
+
smartpush-1.4.4.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
|
19
|
+
smartpush-1.4.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|