smartpush 1.2.3__tar.gz → 1.2.4__tar.gz

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.
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smartpush
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: 用于smartpush自动化测试工具包
5
5
  Author: 卢泽彬、邵宇飞、周彦龙
@@ -0,0 +1,37 @@
1
+ # SmartPush_AutoTest
2
+
3
+
4
+
5
+ ## Getting started
6
+
7
+ ## 打包/上传的依赖
8
+ ```
9
+ pip install wheel
10
+ pip install twine
11
+ ```
12
+
13
+
14
+ ## 打包-打包前记得修改版本号
15
+ ```
16
+ python setup.py sdist bdist_wheel
17
+ ```
18
+
19
+
20
+ ## 上传到pipy的命令
21
+ ```
22
+ twine upload dist/*
23
+ ```
24
+
25
+ # 平台调用demo
26
+ ```
27
+ import json # import 请置于行首
28
+ from smartpush.export.basic import ExcelExportChecker
29
+ from smartpush.export.basic import GetOssUrl
30
+ oss=GetOssUrl.get_oss_address_with_retry(vars['queryOssId'], "${em_host}", json.loads(requestHeaders))
31
+ result = ExcelExportChecker.check_excel_all(expected_oss=oss,actual_oss=vars['exportedOss'],ignore_sort =True)
32
+ assert result
33
+ ```
34
+ ## check_excel_all() 支持拓展参数
35
+ ### check_type = "including" 如果需要预期结果包含可传 eg.联系人导出场景可用
36
+ ### ignore_sort = True 如果需要忽略内部的行排序问题可传,eg.email热点点击数据导出无排序可用
37
+ ### skiprows = 1 传1可忽略第一行, eg.如flow的导出可用,动态表头不固定时可以跳过读取第一行
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='smartpush',
5
- version='1.2.3',
5
+ version='1.2.4',
6
6
  description='用于smartpush自动化测试工具包',
7
7
  author='卢泽彬、邵宇飞、周彦龙',
8
8
  packages=find_packages(),
@@ -95,13 +95,14 @@ def read_excel_and_write_to_dict(excel_data=None, file_name=None, **kwargs):
95
95
  for sheet_name, row in dfs.items():
96
96
  row = row.to_dict(orient='records')
97
97
  if kwargs.get("ignore_sort", False):
98
- sorted_data_asc = sorted(row[1:], key=lambda x: x[0], reverse=True) # 内部排序
98
+ sorted_data_asc = sorted(row[1:], key=lambda x: x[1], reverse=True) # 内部排序
99
99
  sorted_data_asc = [row[0]] + sorted_data_asc
100
100
  row_dict[sheet_name] = sorted_data_asc
101
101
  else:
102
102
  row_dict[sheet_name] = row
103
103
  else:
104
104
  row_dict = dfs.to_dict()
105
+ print(row_dict)
105
106
  return row_dict
106
107
  except zipfile.BadZipFile:
107
108
  print(f"文件读取错误,请检查文件是否为无效文件:{dfs}")
@@ -0,0 +1,33 @@
1
+ # -*- codeing = utf-8 -*-
2
+ # @Time :2025/2/20 00:27
3
+ # @Author :luzebin
4
+ import pandas as pd
5
+
6
+ from smartpush.export.basic.ExcelExportChecker import check_excel_all, read_excel_and_write_to_list, \
7
+ read_excel_from_oss, read_excel_csv_data, check_excel
8
+ from smartpush.export.basic.ReadExcel import read_excel_from_oss
9
+ from smartpush.export.basic.ReadExcel import read_excel_and_write_to_dict
10
+ from smartpush.export.basic.GetOssUrl import get_oss_address_with_retry
11
+
12
+ if __name__ == '__main__':
13
+ oss1 = "https://cdn.smartpushedm.com/material_ec2/2025-03-03/195a4a0d37724bd6b86f7a8477aa7b94/%E8%A1%A8%E5%8D%95%E4%BB%BB%E5%8A%A1%E6%95%B0%E6%8D%AE%E6%A6%82%E8%A7%88.xlsx"
14
+ oss2 = "https://cdn.smartpushedm.com/material_ec2/2025-01-23/adf5404751e44e768e24be61000a42f1/%E8%A1%A8%E5%8D%95%E4%BB%BB%E5%8A%A1%E6%95%B0%E6%8D%AE%E6%A6%82%E8%A7%88.xlsx"
15
+ # # print(check_excel_all(oss1, oss1))
16
+ # oss3 = "https://cdn.smartpushedm.com/material_ec2/2025-02-25/58c4a3a885884741b22380c360ac2894/【自动化导出】营销活动URL点击与热图.xlsx"
17
+ # oss4 = "https://cdn.smartpushedm.com/material_ec2/2025-02-26/58cee630b4c84eec9572b867af4ce692/%E3%80%90%E8%87%AA%E5%8A%A8%E5%8C%96%E5%AF%BC%E5%87%BA%E3%80%91%E8%90%A5%E9%94%80%E6%B4%BB%E5%8A%A8URL%E7%82%B9%E5%87%BB%E4%B8%8E%E7%83%AD%E5%9B%BE.xlsx"
18
+ # expected_oss = "https://cdn.smartpushedm.com/material_ec2/2025-02-26/757df7e77ce544e193257c0da35a4983/%E3%80%90%E8%87%AA%E5%8A%A8%E5%8C%96%E5%AF%BC%E5%87%BA%E3%80%91%E8%90%A5%E9%94%80%E6%B4%BB%E5%8A%A8%E6%95%B0%E6%8D%AE%E6%A6%82%E8%A7%88.xlsx"
19
+ # actual_oss = "https://cdn.smartpushedm.com/material_ec2/2025-02-26/757df7e77ce544e193257c0da35a4983/%E3%80%90%E8%87%AA%E5%8A%A8%E5%8C%96%E5%AF%BC%E5%87%BA%E3%80%91%E8%90%A5%E9%94%80%E6%B4%BB%E5%8A%A8%E6%95%B0%E6%8D%AE%E6%A6%82%E8%A7%88.xlsx"
20
+
21
+ # e_person_oss1 = "https://cdn.smartpushedm.com/material_ec2/2025-02-27/b48f34b3e88045d189631ec1f0f23d51/%E5%AF%BC%E5%87%BA%E5%85%A8%E9%83%A8%E5%AE%A2%E6%88%B7.csv"
22
+ # a_person_oss2 = "https://cdn.smartpushedm.com/material_ec2/2025-02-27/c50519d803c04e3b9b52d9f625fed413/%E5%AF%BC%E5%87%BA%E5%85%A8%E9%83%A8%E5%AE%A2%E6%88%B7.csv"
23
+
24
+ # # #actual_oss= get_oss_address_with_retry("23161","https://cdn.smartpushedm.com/material_ec2_prod/2025-02-20/dae941ec20964ca5b106407858676f89/%E7%BE%A4%E7%BB%84%E6%95%B0%E6%8D%AE%E6%A6%82%E8%A7%88.xlsx","",'{"page":1,"pageSize":10,"type":null,"status":null,"startTime":null,"endTime":null}')
25
+ # # res=read_excel_and_write_to_dict(read_excel_from_oss(actual_oss))
26
+ # # print(res)
27
+ # # print(read_excel_and_write_to_dict(read_excel_from_oss(oss1), type=".xlsx"))
28
+ # print(check_excel(check_type="all", actual_oss=actual_oss, expected_oss=expected_oss))
29
+ # print(check_excel_all(actual_oss=oss1, expected_oss=oss2,skiprows =1))
30
+ # print(check_excel_all(actual_oss=oss1, expected_oss=oss2,ignore_sort=True))
31
+ # print(check_excel_all(actual_oss=a_person_oss2, expected_oss=e_person_oss1, check_type="including"))
32
+ print(check_excel_all(actual_oss=oss1, expected_oss=oss2, ignore_sort=True))
33
+ # read_excel_csv_data(type=)
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smartpush
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: 用于smartpush自动化测试工具包
5
5
  Author: 卢泽彬、邵宇飞、周彦龙
smartpush-1.2.3/README.md DELETED
@@ -1,23 +0,0 @@
1
- # SmartPush_AutoTest
2
-
3
-
4
-
5
- ## Getting started
6
-
7
- ## 打包/上传的依赖
8
- ```
9
- pip install wheel
10
- pip install twine
11
- ```
12
-
13
-
14
- ## 打包-打包前记得修改版本号
15
- ```
16
- python setup.py sdist bdist_wheel
17
- ```
18
-
19
-
20
- ## 上传到pipy的命令
21
- ```
22
- twine upload dist/*
23
- ```
@@ -1,33 +0,0 @@
1
- # -*- codeing = utf-8 -*-
2
- # @Time :2025/2/20 00:27
3
- # @Author :luzebin
4
- import pandas as pd
5
-
6
- from smartpush.export.basic.ExcelExportChecker import check_excel_all, read_excel_and_write_to_list, \
7
- read_excel_from_oss, read_excel_csv_data, check_excel
8
- from smartpush.export.basic.ReadExcel import read_excel_from_oss
9
- from smartpush.export.basic.ReadExcel import read_excel_and_write_to_dict
10
- from smartpush.export.basic.GetOssUrl import get_oss_address_with_retry
11
-
12
- if __name__ == '__main__':
13
- oss1 = "https://cdn.smartpushedm.com/material_ec2/2025-02-25/58c4a3a885884741b22380c360ac2894/【自动化导出】营销活动URL点击与热图.xlsx"
14
- oss2 = "https://cdn.smartpushedm.com/material_ec2/2025-02-27/a5e18e3b3a83432daca871953cb8471b/【自动化导出】营销活动URL点击与热图.xlsx"
15
- # # print(check_excel_all(oss1, oss1))
16
- oss3 = "https://cdn.smartpushedm.com/material_ec2/2025-02-25/58c4a3a885884741b22380c360ac2894/【自动化导出】营销活动URL点击与热图.xlsx"
17
- oss4 = "https://cdn.smartpushedm.com/material_ec2/2025-02-26/58cee630b4c84eec9572b867af4ce692/%E3%80%90%E8%87%AA%E5%8A%A8%E5%8C%96%E5%AF%BC%E5%87%BA%E3%80%91%E8%90%A5%E9%94%80%E6%B4%BB%E5%8A%A8URL%E7%82%B9%E5%87%BB%E4%B8%8E%E7%83%AD%E5%9B%BE.xlsx"
18
- expected_oss = "https://cdn.smartpushedm.com/material_ec2/2025-02-26/757df7e77ce544e193257c0da35a4983/%E3%80%90%E8%87%AA%E5%8A%A8%E5%8C%96%E5%AF%BC%E5%87%BA%E3%80%91%E8%90%A5%E9%94%80%E6%B4%BB%E5%8A%A8%E6%95%B0%E6%8D%AE%E6%A6%82%E8%A7%88.xlsx"
19
- actual_oss = "https://cdn.smartpushedm.com/material_ec2/2025-02-26/757df7e77ce544e193257c0da35a4983/%E3%80%90%E8%87%AA%E5%8A%A8%E5%8C%96%E5%AF%BC%E5%87%BA%E3%80%91%E8%90%A5%E9%94%80%E6%B4%BB%E5%8A%A8%E6%95%B0%E6%8D%AE%E6%A6%82%E8%A7%88.xlsx"
20
-
21
- e_person_oss1 = "https://cdn.smartpushedm.com/material_ec2/2025-02-27/b48f34b3e88045d189631ec1f0f23d51/%E5%AF%BC%E5%87%BA%E5%85%A8%E9%83%A8%E5%AE%A2%E6%88%B7.csv"
22
- a_person_oss2 = "https://cdn.smartpushedm.com/material_ec2/2025-02-27/c50519d803c04e3b9b52d9f625fed413/%E5%AF%BC%E5%87%BA%E5%85%A8%E9%83%A8%E5%AE%A2%E6%88%B7.csv"
23
-
24
- # # #actual_oss= get_oss_address_with_retry("23161","https://cdn.smartpushedm.com/material_ec2_prod/2025-02-20/dae941ec20964ca5b106407858676f89/%E7%BE%A4%E7%BB%84%E6%95%B0%E6%8D%AE%E6%A6%82%E8%A7%88.xlsx","",'{"page":1,"pageSize":10,"type":null,"status":null,"startTime":null,"endTime":null}')
25
- # # res=read_excel_and_write_to_dict(read_excel_from_oss(actual_oss))
26
- # # print(res)
27
- # # print(read_excel_and_write_to_dict(read_excel_from_oss(oss1), type=".xlsx"))
28
- # print(check_excel(check_type="all", actual_oss=actual_oss, expected_oss=expected_oss))
29
- # print(check_excel_all(actual_oss=oss1, expected_oss=oss2,skiprows =1))
30
- print(check_excel_all(actual_oss=oss1, expected_oss=oss2,ignore_sort=True))
31
- # print(check_excel_all(actual_oss=a_person_oss2, expected_oss=e_person_oss1, check_type="including"))
32
- # print(check_excel_all(actual_oss=e_person_oss1, expected_oss=a_person_oss2, check_type="person"))
33
- # read_excel_csv_data(type=)
File without changes