smartpush 1.0.6__py3-none-any.whl → 1.0.7__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/export/basic/ExcelExportChecker.py +5 -24
- smartpush/felix_test.py +3 -3
- {smartpush-1.0.6.dist-info → smartpush-1.0.7.dist-info}/METADATA +1 -1
- smartpush-1.0.7.dist-info/RECORD +10 -0
- smartpush-1.0.6.dist-info/RECORD +0 -10
- {smartpush-1.0.6.dist-info → smartpush-1.0.7.dist-info}/WHEEL +0 -0
- {smartpush-1.0.6.dist-info → smartpush-1.0.7.dist-info}/top_level.txt +0 -0
@@ -89,8 +89,7 @@ def read_excel_and_write_to_list(excel_data=None, file_name=None, **kwargs):
|
|
89
89
|
|
90
90
|
with warnings.catch_warnings():
|
91
91
|
warnings.filterwarnings("ignore", category=UserWarning, module=re.escape('openpyxl.styles.stylesheet'))
|
92
|
-
df = pd.read_excel(excel_data, engine="openpyxl", **kwargs)
|
93
|
-
print(df)
|
92
|
+
df = pd.read_excel(excel_data, engine="openpyxl", na_filter=False, **kwargs)
|
94
93
|
# 将DataFrame转换为字典,以行为单位存储数据
|
95
94
|
rows_list = df.values.tolist()
|
96
95
|
return rows_list
|
@@ -240,8 +239,6 @@ def check_excel_content(actual, expected):
|
|
240
239
|
"""
|
241
240
|
try:
|
242
241
|
# TODO 嵌套list -dict 比较失败
|
243
|
-
print(actual)
|
244
|
-
print(expected)
|
245
242
|
if actual == expected:
|
246
243
|
return True, ["excel内容-完全匹配"]
|
247
244
|
else:
|
@@ -254,29 +251,22 @@ def check_excel_content(actual, expected):
|
|
254
251
|
errors.append("excel内容-预期和实际行数相等,为" + str(actual_num) + "行")
|
255
252
|
else:
|
256
253
|
errors.append(
|
257
|
-
"excel内容-行数和预期对比差" + check_row.__str__() + "行" + ", 实际:" + str(
|
258
|
-
actual_num) + "预期: " + str(
|
259
|
-
expected_num))
|
254
|
+
"excel内容-行数和预期对比差" + check_row.__str__() + "行" + ", 实际:" + str(actual_num) + "预期: " + str(expected_num))
|
260
255
|
# 断言不匹配行
|
261
256
|
if check_row >= 0:
|
262
257
|
num = len(expected)
|
263
258
|
else:
|
264
259
|
num = len(actual)
|
265
260
|
for i in range(num):
|
266
|
-
# 将nan转换成None
|
267
|
-
actual[i] = [None if isinstance(x, (float, int)) and np.isnan(x) else x for x in actual[i]]
|
268
|
-
expected[i] = [None if isinstance(x, (float, int)) and np.isnan(x) else x for x in expected[i]]
|
269
261
|
if actual[i] == expected[i]:
|
270
262
|
continue
|
271
263
|
else:
|
272
264
|
errors.append(
|
273
|
-
"excel内容-第" + str(i + 1) + "行不匹配,预期为:" + str(expected[i]) + ", 实际为: " + str(
|
274
|
-
actual[i]))
|
265
|
+
"excel内容-第" + str(i + 1) + "行不匹配,预期为:" + str(expected[i]) + ", 实际为: " + str(actual[i]))
|
275
266
|
return False, errors
|
276
267
|
except Exception as e:
|
277
|
-
|
278
|
-
|
279
|
-
# return False, [e]
|
268
|
+
print(f":excel内容-服务异常{e}")
|
269
|
+
return False, [e]
|
280
270
|
|
281
271
|
|
282
272
|
def del_temp_file(file_name=""):
|
@@ -290,12 +280,3 @@ def del_temp_file(file_name=""):
|
|
290
280
|
except Exception as e:
|
291
281
|
print(f"删除文件 {file_path} 时出错:{e}")
|
292
282
|
|
293
|
-
|
294
|
-
if __name__ == '__main__':
|
295
|
-
# 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"))
|
296
|
-
eexcelxcel = check_excel_for_lu("all",expected_oss="https://sl-smartfile.oss-ap-southeast-1.aliyuncs.com/material/2025-01-24/3e1048ec9a7949b3be3727e71f4be645"
|
297
|
-
"/AutoTest-%E5%9B%BA%E5%AE%9AB-2025-01-24%20%E5%89%B5%E5%BB%BA%E7%9A%84Email12%E6%95%B0%E6%8D%AE%E6%A6%82%E8"
|
298
|
-
"%A7%88.xlsx", actual_oss = "https://sl-smartfile.oss-ap-southeast-1.aliyuncs.com/material/2025-01-24/3e1048ec9a7949b3be3727e71f4be645"
|
299
|
-
"/AutoTest-%E5%9B%BA%E5%AE%9AB-2025-01-24%20%E5%89%B5%E5%BB%BA%E7%9A%84Email12%E6%95%B0%E6%8D%AE%E6%A6%82%E8"
|
300
|
-
"%A7%88.xlsx")
|
301
|
-
print(eexcelxcel)
|
smartpush/felix_test.py
CHANGED
@@ -4,13 +4,13 @@ from smartpush.export.basic import ExcelExportChecker
|
|
4
4
|
|
5
5
|
if __name__ == '__main__':
|
6
6
|
|
7
|
-
ossurl1 = "https://cdn.smartpushedm.com/material_ec2/2025-02-10/
|
8
|
-
ossurl2 = "https://cdn.smartpushedm.com/material_ec2/2025-02-10/
|
7
|
+
ossurl1 = "https://cdn.smartpushedm.com/material_ec2/2025-02-10/4f3c7f2ad92946a894e3df9176341e1c/%E7%94%A8%E6%88%B7%E7%95%99%E5%AD%98.xlsx"
|
8
|
+
ossurl2 = "https://cdn.smartpushedm.com/material_ec2/2025-02-10/238f1f143d34441e9cfd61ba68ce8dd1/%E7%94%A8%E6%88%B7%E7%95%99%E5%AD%98.xlsx"
|
9
9
|
#
|
10
10
|
# # a = ExcelExportChecker.read_excel_and_write_to_list(excel_data=ExcelExportChecker.read_excel_from_oss(url=ossurl1))
|
11
11
|
# # b = ExcelExportChecker.read_excel_and_write_to_list(excel_data=ExcelExportChecker.read_excel_from_oss(url=ossurl2))
|
12
12
|
# # print(ExcelExportChecker.check_excel(actual=a, expected=b))
|
13
|
-
print(ExcelExportChecker.check_excel(check_type="
|
13
|
+
print(ExcelExportChecker.check_excel(check_type="content", actual_oss=ossurl1, expected_oss=ossurl2))
|
14
14
|
|
15
15
|
# a = ['2025-01-02', 1, '100%', 0.0, '0%', 0.0, '0%', nan, nan]
|
16
16
|
# b = ['2025-01-02', 1, '100%', 0.0, '0%', 0.0, '0%', nan, nan]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
smartpush/__init__.py,sha256=XJrl1vhGATHSeSVqKmPXxYqxyseriUpvY5tLIXir3EE,24
|
2
|
+
smartpush/felix_test.py,sha256=CpB1NMDZ4RAtE028XVYfhxTU7RQPSqlWN6ejGO7ww7I,1020
|
3
|
+
smartpush/get_jira_info.py,sha256=dmCwkKa94xwyE2hegE1KBI3cV_LbrJ67P9osORUGPt4,2633
|
4
|
+
smartpush/export/__init__.py,sha256=D9GbWcmwnetEndFDty5XbVienFK1WjqV2yYcQp3CM84,99
|
5
|
+
smartpush/export/basic/ExcelExportChecker.py,sha256=T9eDPgNh5zekCAdKFu67aHjQPhKQKzK1BUGtn7UQuh0,12187
|
6
|
+
smartpush/export/basic/__init__.py,sha256=6tcrS-2NSlsJo-UwEsnGUmwCf7jgOsh_UEbM0FD-gYE,70
|
7
|
+
smartpush-1.0.7.dist-info/METADATA,sha256=yzrYvDW9A0LEV_wFXD39PwOEGo7JjwSf4e-qprMvcVg,145
|
8
|
+
smartpush-1.0.7.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
9
|
+
smartpush-1.0.7.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
|
10
|
+
smartpush-1.0.7.dist-info/RECORD,,
|
smartpush-1.0.6.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
smartpush/__init__.py,sha256=XJrl1vhGATHSeSVqKmPXxYqxyseriUpvY5tLIXir3EE,24
|
2
|
-
smartpush/felix_test.py,sha256=V6TMemTQDzz-tKRHEatUYQeEXLrbefKW7jLiBJ9wy7k,1016
|
3
|
-
smartpush/get_jira_info.py,sha256=dmCwkKa94xwyE2hegE1KBI3cV_LbrJ67P9osORUGPt4,2633
|
4
|
-
smartpush/export/__init__.py,sha256=D9GbWcmwnetEndFDty5XbVienFK1WjqV2yYcQp3CM84,99
|
5
|
-
smartpush/export/basic/ExcelExportChecker.py,sha256=HsxDvEjrbz7eOqGUWFl0nstDfFNEMHeQcu4xL03nZuk,13818
|
6
|
-
smartpush/export/basic/__init__.py,sha256=6tcrS-2NSlsJo-UwEsnGUmwCf7jgOsh_UEbM0FD-gYE,70
|
7
|
-
smartpush-1.0.6.dist-info/METADATA,sha256=Gq0meSdGsWSClFVvUfb3q2nyJCvwU09DqdskXexIys0,145
|
8
|
-
smartpush-1.0.6.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
9
|
-
smartpush-1.0.6.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
|
10
|
-
smartpush-1.0.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|