smartpush 1.9.6__py3-none-any.whl → 1.9.8__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/crowd/crowd.py +7 -11
- smartpush/flow/MockFlow.py +12 -7
- smartpush/utils/ListDictUtils.py +14 -1
- {smartpush-1.9.6.dist-info → smartpush-1.9.8.dist-info}/METADATA +1 -1
- {smartpush-1.9.6.dist-info → smartpush-1.9.8.dist-info}/RECORD +7 -7
- {smartpush-1.9.6.dist-info → smartpush-1.9.8.dist-info}/WHEEL +0 -0
- {smartpush-1.9.6.dist-info → smartpush-1.9.8.dist-info}/top_level.txt +0 -0
smartpush/crowd/crowd.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import time
|
|
3
|
-
|
|
3
|
+
from smartpush.utils import ListDictUtils
|
|
4
4
|
from smartpush.base.request_base import CrowdRequestBase, RequestBase
|
|
5
5
|
from smartpush.base.url_enum import URL
|
|
6
6
|
from smartpush.export.basic.ExcelExportChecker import compare_lists, compare_dicts
|
|
@@ -61,24 +61,20 @@ class Crowd(CrowdRequestBase):
|
|
|
61
61
|
result = {}
|
|
62
62
|
# 校验群组详情条件
|
|
63
63
|
crowd_detail = self.callCrowdPackageDetail()
|
|
64
|
-
if crowd_detail["
|
|
64
|
+
if crowd_detail["groupRules"] == expected_rule:
|
|
65
65
|
result["rule"] = True
|
|
66
66
|
else:
|
|
67
|
-
result["rule"] = {"条件断言": False, "实际条件": crowd_detail["
|
|
67
|
+
result["rule"] = {"条件断言": False, "实际条件": crowd_detail["groupRules"]}
|
|
68
68
|
# 校验群组筛选人群
|
|
69
69
|
time.sleep(sleep)
|
|
70
70
|
crowd_persons = self.callCrowdPersonListInPackage()
|
|
71
|
-
crowd_person_uids = [person["uid"] for person in crowd_persons]
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
else:
|
|
76
|
-
result["uid"] = True
|
|
77
|
-
|
|
71
|
+
crowd_person_uids = [person["uid"] for person in crowd_persons["responseResult"]]
|
|
72
|
+
print("expected_ids", expected_ids, type(expected_ids))
|
|
73
|
+
print("crowd_person_uids", crowd_person_uids, type(crowd_person_uids))
|
|
74
|
+
result["联系人断言"] = ListDictUtils.check_values_in_list_set(a=expected_ids, b=crowd_person_uids)
|
|
78
75
|
return result
|
|
79
76
|
|
|
80
77
|
|
|
81
|
-
|
|
82
78
|
class CrowdList(RequestBase):
|
|
83
79
|
def callCrowdPackageList(self, page=1, pageSize=20):
|
|
84
80
|
"""
|
smartpush/flow/MockFlow.py
CHANGED
|
@@ -102,16 +102,13 @@ def check_flow(host_domain, cookies, mock_domain="", **kwargs):
|
|
|
102
102
|
split_node: list,有拆分节点时需填,结构:如: ["false", "true"],即走到拆分节点限制不满足分支再走满足分支
|
|
103
103
|
get_email_content: bool,默认false, 提取邮件内容,用于断言邮箱内是否送达
|
|
104
104
|
"""
|
|
105
|
-
# todo: 还差邮件校验部分,后续补充
|
|
106
105
|
is_split_steps = kwargs.get("split_steps", "all")
|
|
107
106
|
# 步骤1 - 所需字段:split_steps、host_domain、cookies、flow_id、pulsar
|
|
108
107
|
if is_split_steps == "one" or is_split_steps == "all":
|
|
109
|
-
#
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
kwargs["old_flow_counts"] = old_flow_counts
|
|
114
|
-
print(f"触发前节点数据: {old_flow_counts}")
|
|
108
|
+
# 提取版本号
|
|
109
|
+
_, old_versions, _ = get_current_flow(host_domain=host_domain, cookies=cookies,
|
|
110
|
+
flow_id=kwargs["flow_id"],
|
|
111
|
+
splits=kwargs.get("split_node", None))
|
|
115
112
|
# 更新flow
|
|
116
113
|
if kwargs.get("update_flow_params", False):
|
|
117
114
|
global_flow.update_flow(host_domain=host_domain, cookies=cookies,
|
|
@@ -124,6 +121,14 @@ def check_flow(host_domain, cookies, mock_domain="", **kwargs):
|
|
|
124
121
|
# 启动flow
|
|
125
122
|
global_flow.start_flow(host_domain=host_domain, cookies=cookies, flow_id=kwargs["flow_id"],
|
|
126
123
|
version=old_versions, draft_snap_version=draft_snap_version)
|
|
124
|
+
|
|
125
|
+
# 触发前提取flow数据,后续做对比
|
|
126
|
+
old_flow_counts, _, _ = get_current_flow(host_domain=host_domain, cookies=cookies,
|
|
127
|
+
flow_id=kwargs["flow_id"],
|
|
128
|
+
splits=kwargs.get("split_node", None))
|
|
129
|
+
time.sleep(3)
|
|
130
|
+
kwargs["old_flow_counts"] = old_flow_counts
|
|
131
|
+
print(f"触发前节点数据: {old_flow_counts}")
|
|
127
132
|
# 触发flow
|
|
128
133
|
mock_pulsar(mock_domain=mock_domain, pulsar=kwargs["pulsar"], limit=kwargs.get("limit", 1))
|
|
129
134
|
if is_split_steps == "one":
|
smartpush/utils/ListDictUtils.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from deepdiff import DeepDiff
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def compare_lists(temp1, temp2, check_key=["completedCount"], all_key=False, num=1):
|
|
@@ -70,3 +70,16 @@ def all_in_list(list_a, list_b):
|
|
|
70
70
|
# 支持列表、元组、集合等可迭代类型
|
|
71
71
|
print(f"判断对象【{list_a}】在 {list_b}")
|
|
72
72
|
return set(list_a).issubset(set(list_b))
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def check_values_in_list_set(a, b):
|
|
76
|
+
"""
|
|
77
|
+
使用集合检查列表a中的所有值是否都在列表b中(效率更高)
|
|
78
|
+
"""
|
|
79
|
+
set_b = set(b)
|
|
80
|
+
missing_values = [x for x in a if x not in set_b]
|
|
81
|
+
|
|
82
|
+
if not missing_values:
|
|
83
|
+
return [True, "匹配成功"]
|
|
84
|
+
else:
|
|
85
|
+
return [False, "匹配失败,不匹配数据" + str(missing_values)]
|
|
@@ -7,7 +7,7 @@ smartpush/base/faker_data.py,sha256=TOd5EKVImxZpsKEW_dtKa2iqiUGqU7OBkOM8pvqKVUc,
|
|
|
7
7
|
smartpush/base/request_base.py,sha256=mg0dSm6ucPdwqSUn_tQzynYWYKf0_vX7kcGJWSsX3e0,2455
|
|
8
8
|
smartpush/base/url_enum.py,sha256=GC8lXuXflKFl3xbeOIzS3vgE7BF2Zo5H9pn6okgHPyQ,1627
|
|
9
9
|
smartpush/crowd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
smartpush/crowd/crowd.py,sha256
|
|
10
|
+
smartpush/crowd/crowd.py,sha256=-UrOLAhWaYXUk3V2ezy4xkYDxJAmKD1KtccSrPm5PQY,21059
|
|
11
11
|
smartpush/email/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
smartpush/email/schema.py,sha256=Gf9tYNP9UjkbXpPbh_uAcAx7QZ5RNs-E7GPVp1BU9d8,23478
|
|
13
13
|
smartpush/email/universal_content.py,sha256=By8ZzhPEvTYuktPfh_wRwRSYnntwoV5qJd3mXzkrSg4,9063
|
|
@@ -16,7 +16,7 @@ smartpush/export/basic/ExcelExportChecker.py,sha256=YqWmDGSFadQdK2vNJ070Qvad9Ztq
|
|
|
16
16
|
smartpush/export/basic/GetOssUrl.py,sha256=zxNZj6x7Ph9N3P5k82pLpBFjZxKrDfbgqS2fTYyhvso,8467
|
|
17
17
|
smartpush/export/basic/ReadExcel.py,sha256=SbVRBKd4Y1UPUXXnvyQ3J6WtZLinwTCYpBos1D6_wtU,8921
|
|
18
18
|
smartpush/export/basic/__init__.py,sha256=6tcrS-2NSlsJo-UwEsnGUmwCf7jgOsh_UEbM0FD-gYE,70
|
|
19
|
-
smartpush/flow/MockFlow.py,sha256=
|
|
19
|
+
smartpush/flow/MockFlow.py,sha256=L-T_x8hieHs1nPDsP2BUSa6q4pVuiURVN2xP9njakzs,7943
|
|
20
20
|
smartpush/flow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
smartpush/flow/global_flow.py,sha256=D1hCpO5fsWTEfl4yNpi3O8PFhz_UmKLHSIQhKtypkvU,2817
|
|
22
22
|
smartpush/flow/history_flow.py,sha256=Gds1FI6i9ue-n1WwpNgL2JlQ2PhSR8VK7dvZ9JemZKw,4854
|
|
@@ -27,11 +27,11 @@ smartpush/form/form_before.py,sha256=CCvAC_2yWPlnQGtjEA8LPLy9853Nq3nNjcL2GewFWIs
|
|
|
27
27
|
smartpush/form/form_client_operation.py,sha256=gg-5uHXCyMa_ypBSYPYFVxXdwZdYBJsNtUCqayknMBw,303
|
|
28
28
|
smartpush/utils/DataTypeUtils.py,sha256=BC7ioztO3vAfKd1EOoNvXdVuXYY8qjNskV1DP7LhW-M,1082
|
|
29
29
|
smartpush/utils/EmailUtlis.py,sha256=DAHd73bJ8hiJCLEXtD0xcwxPD7SOPSmBB7Jvlf6gN6s,11201
|
|
30
|
-
smartpush/utils/ListDictUtils.py,sha256=
|
|
30
|
+
smartpush/utils/ListDictUtils.py,sha256=6jIngO_4vARkKTKRb9ZW4wR7zPkYbc1wiMLF7ySZQXc,3191
|
|
31
31
|
smartpush/utils/StringUtils.py,sha256=n8mo9k0JQN63MReImgv-66JxmmymOGknR8pH2fkQrAo,4139
|
|
32
32
|
smartpush/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
smartpush/utils/form_utils.py,sha256=ld-g_Dm_ZlnagQt7imYfUc87bcBRVlTctywuLtzmjXQ,849
|
|
34
|
-
smartpush-1.9.
|
|
35
|
-
smartpush-1.9.
|
|
36
|
-
smartpush-1.9.
|
|
37
|
-
smartpush-1.9.
|
|
34
|
+
smartpush-1.9.8.dist-info/METADATA,sha256=ocrGVX8kR0kE0c9y61_E9wck8yNGFExrAuK9XApli2c,131
|
|
35
|
+
smartpush-1.9.8.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
36
|
+
smartpush-1.9.8.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
|
|
37
|
+
smartpush-1.9.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|