smartpush 1.1.0__py3-none-any.whl → 1.1.1__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.
@@ -170,7 +170,8 @@ def check_excel(check_type="content", **kwargs):
170
170
  expected_content = read_excel_and_write_to_list(excel_data=read_excel_from_oss(url=kwargs["expected_oss"]))
171
171
  flag1, content_result = check_excel_content(actual=actual_content, expected=expected_content)
172
172
  flag2, name_result = check_excel_name(actual_oss=kwargs["actual_oss"], expected_oss=kwargs["expected_oss"])
173
- return flag1 and flag2, {"文件名称": name_result, "导出内容": content_result}
173
+ flag3 = check_excel_header(actual_oss=kwargs["actual_oss"], expected_oss=kwargs["expected_oss"])
174
+ return all([flag1, flag2, flag3]), {"文件名称": name_result, "导出内容": content_result}
174
175
  else:
175
176
  return False, f"不支持此类型: {check_type}"
176
177
  except Exception as e:
@@ -232,8 +233,9 @@ def check_excel_all(actual_oss, expected_oss):
232
233
  """
233
234
  flag1, content_result = check_excel_content_form_oss(actual_oss, expected_oss)
234
235
  flag2, name_result = check_excel_name(actual_oss, expected_oss)
235
- flag3 = check_sheet_header(actual_oss, expected_oss)
236
- return all([flag1, flag2, flag3]), {"文件名称": name_result, "导出内容": content_result, "校验结果": [flag1, flag2, flag3]}
236
+ flag3 = check_excel_header(actual_oss, expected_oss)
237
+ return all([flag1, flag2, flag3]), {"文件名称": name_result, "导出内容": content_result,
238
+ "校验结果": [flag1, flag2, flag3]}
237
239
 
238
240
 
239
241
  def check_excel_name(actual_oss, expected_oss):
@@ -271,7 +273,8 @@ def check_excel_content(actual, expected):
271
273
  errors.append("excel内容-预期和实际行数相等,为" + str(actual_num) + "行")
272
274
  else:
273
275
  errors.append(
274
- "excel内容-行数和预期对比差" + check_row.__str__() + "行" + ", 实际:" + str(actual_num) + "预期: " + str(
276
+ "excel内容-行数和预期对比差" + check_row.__str__() + "行" + ", 实际:" + str(
277
+ actual_num) + "预期: " + str(
275
278
  expected_num))
276
279
  # 断言不匹配行
277
280
  if check_row >= 0:
@@ -311,4 +314,4 @@ def del_temp_file(file_name=""):
311
314
  except FileNotFoundError:
312
315
  print(f"文件 {file_path} 不存在。")
313
316
  except Exception as e:
314
- print(f"删除文件 {file_path} 时出错:{e}")
317
+ print(f"删除文件 {file_path} 时出错:{e}")
smartpush/test.py CHANGED
@@ -1,11 +1,10 @@
1
- from smartpush.export.basic.ExcelExportChecker import check_excel_for_lu
1
+ from smartpush.export.basic.ExcelExportChecker import *
2
2
  from smartpush.export.basic.GetOssUrl import get_oss_address_with_retry
3
+
3
4
  import urllib3
4
5
 
5
6
  if __name__ == '__main__':
6
7
  # print(check_excel_for_lu("content",actual_oss="https://sl-smartfile.oss-ap-southeast-1.aliyuncs.com/material_ec2_prod/2025-01-20/fcb98e2965314ef2862db65760dcce1f/ab%E5%BC%B9%E7%AA%97%E6%B4%BB%E5%8A%A8-%E8%BD%AC%E5%8C%96%E7%8E%87%E8%8E%B7%E8%83%9C%E9%94%80%E5%94%AE%E9%A2%9D%E6%98%8E%E7%BB%86%E6%95%B0%E6%8D%AE.xlsx",expected_oss="https://sl-smartfile.oss-ap-southeast-1.aliyuncs.com/material_ec2_prod/2025-01-20/fcb98e2965314ef2862db65760dcce1f/ab%E5%BC%B9%E7%AA%97%E6%B4%BB%E5%8A%A8-%E8%BD%AC%E5%8C%96%E7%8E%87%E8%8E%B7%E8%83%9C%E9%94%80%E5%94%AE%E9%A2%9D%E6%98%8E%E7%BB%86%E6%95%B0%E6%8D%AE.xlsx"))
7
-
8
-
9
8
  _id = 10901
10
9
  url = "https://test.smartpushedm.com/api-em-ec2/bulkOps/query"
11
10
  requestHeaders = {
@@ -13,7 +12,7 @@ if __name__ == '__main__':
13
12
  'Content-Type': 'application/json'}
14
13
  requestParams = {'page': 1, 'pageSize': 10, 'type': 'EXPORT', 'status': None, 'startTime': None, 'endTime': None}
15
14
  oss=get_oss_address_with_retry(_id, url, requestHeaders, requestParams, tries=1, delay=1, backoff=1)
16
- eexcelxcel = check_excel_for_lu("all",
17
- expected_oss=oss,
18
- actual_oss=oss)
15
+ check_excel_for_lu("all",oss,oss)
16
+ # oss = "https://cdn.smartpushedm.com/material_sf/2025-02-19/c70bb6f3588b4c89bde6ed75813ea4f3/%E5%AF%BC%E5%87%BA%E5%85%A8%E9%83%A8%E5%AE%A2%E6%88%B7.csv"
17
+ # eexcelxcel =read_excel_and_write_to_list(read_excel_from_oss(oss))
19
18
  print(eexcelxcel)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smartpush
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: 用于smartpush自动化测试工具包
5
5
  Author: 卢泽彬、邵宇飞、周彦龙
6
6
 
@@ -1,13 +1,13 @@
1
1
  smartpush/__init__.py,sha256=XJrl1vhGATHSeSVqKmPXxYqxyseriUpvY5tLIXir3EE,24
2
2
  smartpush/get_jira_info.py,sha256=dmCwkKa94xwyE2hegE1KBI3cV_LbrJ67P9osORUGPt4,2633
3
- smartpush/test.py,sha256=Krng-vkKECW7UPYKwlgh-w0o0xDYrVkXW7W4-L61ueA,2837
3
+ smartpush/test.py,sha256=FTfTwcJEZFPz_Rq8pAooOW_qBN1sbVQbm2htF8mgqDo,2939
4
4
  smartpush/export/__init__.py,sha256=D9GbWcmwnetEndFDty5XbVienFK1WjqV2yYcQp3CM84,99
5
- smartpush/export/basic/ExcelExportChecker.py,sha256=bEfadFHZ0tsPcFXbCLTZguD199PIoYdxhJ9Mce72N7M,12987
5
+ smartpush/export/basic/ExcelExportChecker.py,sha256=Y4agi5F8j1sIgM10Z3yKKs6y7rg4p6-6GSyKMpEITzs,13173
6
6
  smartpush/export/basic/GetOssUrl.py,sha256=O2-HtcYzbabck9dKgLu8ga21_AiyDIzgdfoDgvqBY3c,1541
7
7
  smartpush/export/basic/__init__.py,sha256=6tcrS-2NSlsJo-UwEsnGUmwCf7jgOsh_UEbM0FD-gYE,70
8
8
  smartpush/utils/StringUtils.py,sha256=NXomJ4qmyBRAFnGj5hrFRWwQnRQMTcPzy20fk1dunSw,3980
9
9
  smartpush/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- smartpush-1.1.0.dist-info/METADATA,sha256=LQEsjc2Kv6vo7urDwIaOi-Idf7_a0jBSmAqaS6kSPhk,145
11
- smartpush-1.1.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
12
- smartpush-1.1.0.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
13
- smartpush-1.1.0.dist-info/RECORD,,
10
+ smartpush-1.1.1.dist-info/METADATA,sha256=5tCwRmx5MPLlVdUC695sEQEUDgcVr5TIZJeSVakIJr4,145
11
+ smartpush-1.1.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
12
+ smartpush-1.1.1.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
13
+ smartpush-1.1.1.dist-info/RECORD,,