smartpush 1.0.1.5__py3-none-any.whl → 1.0.1.6__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-1.0.1.5.dist-info → smartpush-1.0.1.6.dist-info}/METADATA +1 -1
- smartpush-1.0.1.6.dist-info/RECORD +5 -0
- autotest/__init__.py +0 -0
- autotest/get_jira_info/__init__.py +0 -0
- autotest/get_jira_info/get_jira_info.py +0 -64
- autotest/setup.py +0 -13
- smartpush/autotest/__init__.py +0 -1
- smartpush/autotest/export/__init__.py +0 -1
- smartpush/autotest/export/basic/ExcelExportChecker.py +0 -114
- smartpush/autotest/export/basic/__init__.py +0 -0
- smartpush/autotest/setup.py +0 -13
- smartpush/get_jira_info/__init__.py +0 -0
- smartpush/get_jira_info/get_jira_info.py +0 -64
- smartpush-1.0.1.5.dist-info/RECORD +0 -16
- {smartpush-1.0.1.5.dist-info → smartpush-1.0.1.6.dist-info}/WHEEL +0 -0
- {smartpush-1.0.1.5.dist-info → smartpush-1.0.1.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,5 @@
|
|
1
|
+
smartpush/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
smartpush-1.0.1.6.dist-info/METADATA,sha256=eUIoAZxwh1Mx6FshYHqRK2rueudKqSX2-h3eGmlHjLk,147
|
3
|
+
smartpush-1.0.1.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
+
smartpush-1.0.1.6.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
|
5
|
+
smartpush-1.0.1.6.dist-info/RECORD,,
|
autotest/__init__.py
DELETED
File without changes
|
File without changes
|
@@ -1,64 +0,0 @@
|
|
1
|
-
from jira import JIRA
|
2
|
-
|
3
|
-
|
4
|
-
def get_custom_fields(jira):
|
5
|
-
all_fields = jira.fields()
|
6
|
-
# print(all_fields)
|
7
|
-
custom_fields = {}
|
8
|
-
for field in all_fields:
|
9
|
-
try:
|
10
|
-
# print(field)
|
11
|
-
if field.get('custom'):
|
12
|
-
if field['scope']['project']['id'] == '10559':
|
13
|
-
custom_fields[field['id']] = field['name']
|
14
|
-
except:
|
15
|
-
continue
|
16
|
-
print(custom_fields)
|
17
|
-
return custom_fields
|
18
|
-
|
19
|
-
|
20
|
-
if __name__ == '__main__':
|
21
|
-
api_key = "ATATT3xFfGF0YeIApQYdm4c671OUkhg5ggVISNgIb0D1Iqpd2dwwunzff98Pc5VQjb74ZN997uXvvxi6LpmNGJx1kW1BLh5AaudMj5RuWTe6uozsGqGpx_QkySeU2HF-JB37kkza9PREOpOSbiDFZxrI0eqYPV9Fe-bJP0RM16V_GSyDPib0wmw=FE3DE2B1"
|
22
|
-
|
23
|
-
# Jira 服务器的 URL
|
24
|
-
jira_url = "https://shopline.atlassian.net/"
|
25
|
-
# Jira API 密钥
|
26
|
-
jira_api_key = api_key
|
27
|
-
# Jira 用户名
|
28
|
-
jira_user = "lu.lu@shopline.com"
|
29
|
-
|
30
|
-
# 连接到 Jira 服务器
|
31
|
-
jira = JIRA(server=jira_url, basic_auth=(jira_user, jira_api_key))
|
32
|
-
|
33
|
-
# 获取一个项目的信息
|
34
|
-
project_key = 10559 # 替换为你想要获取的项目的 key
|
35
|
-
project = jira.project(project_key)
|
36
|
-
print(f"Project: {project.key} - {project.name}")
|
37
|
-
|
38
|
-
all_fields = jira.fields()
|
39
|
-
# print(all_fields)
|
40
|
-
|
41
|
-
# 获取项目的问题
|
42
|
-
issues = jira.search_issues(f"project={project_key}")
|
43
|
-
issue = jira.issue(issues[0])
|
44
|
-
# print("Issue Key:", issue.key)
|
45
|
-
# print("Summary:", issue.fields.summary)
|
46
|
-
# # print("Description:", issue.fields.description)
|
47
|
-
# print("Assignee:", issue.fields.assignee.displayName if issue.fields.assignee else "Unassigned")
|
48
|
-
# print("Reporter:", issue.fields.reporter.displayName)
|
49
|
-
# print("Status:", issue.fields.status.name)
|
50
|
-
# print("Priority:", issue.fields.priority.name)
|
51
|
-
# print("Created:", issue.fields.created)
|
52
|
-
# print("Updated:", issue.fields.updated)
|
53
|
-
# print("Due Date:", issue.fields.duedate)
|
54
|
-
# print("Labels:", issue.fields.labels)
|
55
|
-
# print("Components:", [component.name for component in issue.fields.components])
|
56
|
-
# print(issue.fields.__dict__.items())
|
57
|
-
custom_fields = get_custom_fields(jira)
|
58
|
-
for field_name, field_value in issue.fields.__dict__.items():
|
59
|
-
try:
|
60
|
-
# if field_name.startswith("customfield_"):
|
61
|
-
# continue
|
62
|
-
print(f"Custom Field ID: {field_name}, NAME:{custom_fields[field_name]}, Value: {field_value}")
|
63
|
-
except:
|
64
|
-
continue
|
autotest/setup.py
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
from setuptools import setup, find_packages
|
2
|
-
|
3
|
-
setup(
|
4
|
-
name='smartpush',
|
5
|
-
version='1.0.1',
|
6
|
-
description='用于smartpush自动化测试工具包',
|
7
|
-
author='卢泽彬、邵宇飞、周彦龙',
|
8
|
-
packages=find_packages(),
|
9
|
-
install_requires=[
|
10
|
-
# List your package's dependencies here
|
11
|
-
# TODO
|
12
|
-
],
|
13
|
-
)
|
smartpush/autotest/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
from export import *
|
@@ -1 +0,0 @@
|
|
1
|
-
from basic import *
|
@@ -1,114 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
from io import BytesIO
|
3
|
-
import pandas as pd
|
4
|
-
import numpy as np
|
5
|
-
from requests import request
|
6
|
-
|
7
|
-
|
8
|
-
def read_excel_from_oss(method, url):
|
9
|
-
"""读取oss的excel内容并写入到本地csv"""
|
10
|
-
try:
|
11
|
-
result = request(method=method, url=url)
|
12
|
-
excel_data = BytesIO(result.content)
|
13
|
-
print(f"成功读取oss文件内容: {url}")
|
14
|
-
return excel_data
|
15
|
-
except Exception as e:
|
16
|
-
print(f"读取oss报错 {url} 时出错:{e}")
|
17
|
-
|
18
|
-
|
19
|
-
def read_excel_and_write_to_dict(excel_data=None, file_name=None):
|
20
|
-
"""excel内容并写入到内存dict中
|
21
|
-
:param excel_data:excel的io对象, 参数和file_name互斥
|
22
|
-
:file_name: excel文件名称,目前读取check_file目录下文件,参数和excel_data互斥
|
23
|
-
"""
|
24
|
-
try:
|
25
|
-
if excel_data is not None and file_name is not None:
|
26
|
-
pass
|
27
|
-
elif file_name is not None:
|
28
|
-
excel_data = os.path.join(os.path.dirname(os.getcwd()) + "/check_file/" + file_name)
|
29
|
-
df = pd.read_excel(excel_data, engine="openpyxl")
|
30
|
-
# 将DataFrame转换为字典,以行为单位存储数据
|
31
|
-
row_dict = {} # 创建一个空字典来存储按行转换的数据
|
32
|
-
for index, row in df.iterrows(): # 遍历DataFrame中的每一行
|
33
|
-
row_dict[index] = row.to_dict() # 将每一行转换为字典并存储在row_dict中
|
34
|
-
return row_dict
|
35
|
-
except Exception as e:
|
36
|
-
print(f"excel写入dict时出错:{e}")
|
37
|
-
|
38
|
-
|
39
|
-
def read_excel_and_write_to_list(excel_data=None, file_name=None):
|
40
|
-
"""excel内容并写入到内存list中
|
41
|
-
:param excel_data:excel的io对象, 参数和file_name互斥
|
42
|
-
:file_name: excel文件名称,目前读取check_file目录下文件,参数和excel_data互斥
|
43
|
-
"""
|
44
|
-
try:
|
45
|
-
if excel_data is not None and file_name is not None:
|
46
|
-
pass
|
47
|
-
elif file_name is not None:
|
48
|
-
excel_data = os.path.join(os.path.dirname(os.getcwd()) + "/check_file/" + file_name)
|
49
|
-
df = pd.read_excel(excel_data, engine="openpyxl")
|
50
|
-
# 将DataFrame转换为字典,以行为单位存储数据
|
51
|
-
rows_list = df.values.tolist()
|
52
|
-
return rows_list
|
53
|
-
except Exception as e:
|
54
|
-
print(f"excel写入dict时出错:{e}")
|
55
|
-
|
56
|
-
|
57
|
-
def read_excel_and_write_to_csv(excel_data, file_name):
|
58
|
-
"""excel内容并写入到csv中"""
|
59
|
-
try:
|
60
|
-
df = pd.read_excel(excel_data, engine="openpyxl")
|
61
|
-
local_csv_path = os.path.join(os.path.dirname(os.getcwd()) + "/temp_file/" + file_name)
|
62
|
-
df.to_csv(local_csv_path, index=False)
|
63
|
-
return local_csv_path
|
64
|
-
except Exception as e:
|
65
|
-
print(f"excel写入csv时出错:{e}")
|
66
|
-
|
67
|
-
|
68
|
-
def check_excel(actual, expected):
|
69
|
-
"""对比两份excel内容
|
70
|
-
:param: actual: 实际值,list类型
|
71
|
-
:param: expected: 预期值,list类型
|
72
|
-
"""
|
73
|
-
try:
|
74
|
-
if actual == expected:
|
75
|
-
return True
|
76
|
-
else:
|
77
|
-
errors = []
|
78
|
-
# 断言1:校验行数
|
79
|
-
actual_num = len(actual)
|
80
|
-
expected_num = len(expected)
|
81
|
-
check_row = actual_num - expected_num
|
82
|
-
if check_row == 0:
|
83
|
-
pass
|
84
|
-
else:
|
85
|
-
errors.append(
|
86
|
-
"行数和预期对比差" + check_row.__str__() + "行" + ", 实际:" + str(actual_num) + "预期: " + str(
|
87
|
-
expected_num))
|
88
|
-
# 断言不匹配行
|
89
|
-
if check_row >= 0:
|
90
|
-
num = len(expected)
|
91
|
-
else:
|
92
|
-
num = len(actual)
|
93
|
-
for i in range(num):
|
94
|
-
if actual[i] == expected[i]:
|
95
|
-
continue
|
96
|
-
else:
|
97
|
-
errors.append(
|
98
|
-
"第" + str(i + 1) + "行不匹配,预期为:" + str(expected[i]) + ", 实际为: " + str(actual[i]))
|
99
|
-
return False, errors
|
100
|
-
except Exception as e:
|
101
|
-
print(f"对比excel:{e}")
|
102
|
-
|
103
|
-
|
104
|
-
def del_temp_file(file_name=""):
|
105
|
-
"""删除temp下临时文件"""
|
106
|
-
file_path = os.path.join(os.path.dirname(os.getcwd()) + "/temp_file/" + file_name)
|
107
|
-
try:
|
108
|
-
os.remove(file_path)
|
109
|
-
print(f"文件 {file_path} 已成功删除。")
|
110
|
-
except FileNotFoundError:
|
111
|
-
print(f"文件 {file_path} 不存在。")
|
112
|
-
except Exception as e:
|
113
|
-
print(f"删除文件 {file_path} 时出错:{e}")
|
114
|
-
|
File without changes
|
smartpush/autotest/setup.py
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
from setuptools import setup, find_packages
|
2
|
-
|
3
|
-
setup(
|
4
|
-
name='smartpush',
|
5
|
-
version='1.0.1',
|
6
|
-
description='用于smartpush自动化测试工具包',
|
7
|
-
author='卢泽彬、邵宇飞、周彦龙',
|
8
|
-
packages=find_packages(),
|
9
|
-
install_requires=[
|
10
|
-
# List your package's dependencies here
|
11
|
-
# TODO
|
12
|
-
],
|
13
|
-
)
|
File without changes
|
@@ -1,64 +0,0 @@
|
|
1
|
-
from jira import JIRA
|
2
|
-
|
3
|
-
|
4
|
-
def get_custom_fields(jira):
|
5
|
-
all_fields = jira.fields()
|
6
|
-
# print(all_fields)
|
7
|
-
custom_fields = {}
|
8
|
-
for field in all_fields:
|
9
|
-
try:
|
10
|
-
# print(field)
|
11
|
-
if field.get('custom'):
|
12
|
-
if field['scope']['project']['id'] == '10559':
|
13
|
-
custom_fields[field['id']] = field['name']
|
14
|
-
except:
|
15
|
-
continue
|
16
|
-
print(custom_fields)
|
17
|
-
return custom_fields
|
18
|
-
|
19
|
-
|
20
|
-
if __name__ == '__main__':
|
21
|
-
api_key = "ATATT3xFfGF0YeIApQYdm4c671OUkhg5ggVISNgIb0D1Iqpd2dwwunzff98Pc5VQjb74ZN997uXvvxi6LpmNGJx1kW1BLh5AaudMj5RuWTe6uozsGqGpx_QkySeU2HF-JB37kkza9PREOpOSbiDFZxrI0eqYPV9Fe-bJP0RM16V_GSyDPib0wmw=FE3DE2B1"
|
22
|
-
|
23
|
-
# Jira 服务器的 URL
|
24
|
-
jira_url = "https://shopline.atlassian.net/"
|
25
|
-
# Jira API 密钥
|
26
|
-
jira_api_key = api_key
|
27
|
-
# Jira 用户名
|
28
|
-
jira_user = "lu.lu@shopline.com"
|
29
|
-
|
30
|
-
# 连接到 Jira 服务器
|
31
|
-
jira = JIRA(server=jira_url, basic_auth=(jira_user, jira_api_key))
|
32
|
-
|
33
|
-
# 获取一个项目的信息
|
34
|
-
project_key = 10559 # 替换为你想要获取的项目的 key
|
35
|
-
project = jira.project(project_key)
|
36
|
-
print(f"Project: {project.key} - {project.name}")
|
37
|
-
|
38
|
-
all_fields = jira.fields()
|
39
|
-
# print(all_fields)
|
40
|
-
|
41
|
-
# 获取项目的问题
|
42
|
-
issues = jira.search_issues(f"project={project_key}")
|
43
|
-
issue = jira.issue(issues[0])
|
44
|
-
# print("Issue Key:", issue.key)
|
45
|
-
# print("Summary:", issue.fields.summary)
|
46
|
-
# # print("Description:", issue.fields.description)
|
47
|
-
# print("Assignee:", issue.fields.assignee.displayName if issue.fields.assignee else "Unassigned")
|
48
|
-
# print("Reporter:", issue.fields.reporter.displayName)
|
49
|
-
# print("Status:", issue.fields.status.name)
|
50
|
-
# print("Priority:", issue.fields.priority.name)
|
51
|
-
# print("Created:", issue.fields.created)
|
52
|
-
# print("Updated:", issue.fields.updated)
|
53
|
-
# print("Due Date:", issue.fields.duedate)
|
54
|
-
# print("Labels:", issue.fields.labels)
|
55
|
-
# print("Components:", [component.name for component in issue.fields.components])
|
56
|
-
# print(issue.fields.__dict__.items())
|
57
|
-
custom_fields = get_custom_fields(jira)
|
58
|
-
for field_name, field_value in issue.fields.__dict__.items():
|
59
|
-
try:
|
60
|
-
# if field_name.startswith("customfield_"):
|
61
|
-
# continue
|
62
|
-
print(f"Custom Field ID: {field_name}, NAME:{custom_fields[field_name]}, Value: {field_value}")
|
63
|
-
except:
|
64
|
-
continue
|
@@ -1,16 +0,0 @@
|
|
1
|
-
autotest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
autotest/setup.py,sha256=QMjg0X5a_dNn-4Z_tJtq7OzyR5s194nr0tYZCF_Wxoo,326
|
3
|
-
autotest/get_jira_info/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
autotest/get_jira_info/get_jira_info.py,sha256=zXp5OB9fVY5e0RbYcqlcq3ClqwLBAEvAVPZ1A_PrdMg,2416
|
5
|
-
smartpush/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
smartpush/autotest/__init__.py,sha256=9p-roe--gvB9jev8NDIKDm387x4aGFXMpRq4BjIwCNQ,21
|
7
|
-
smartpush/autotest/setup.py,sha256=QMjg0X5a_dNn-4Z_tJtq7OzyR5s194nr0tYZCF_Wxoo,326
|
8
|
-
smartpush/autotest/export/__init__.py,sha256=YYVC_8uz2w8yQ2yRBHJjVM7Xyd2Mhxw6Q1wLDkozCdg,20
|
9
|
-
smartpush/autotest/export/basic/ExcelExportChecker.py,sha256=On167Ba_WECzm-E1wSZpzv-5gIcp9Z7ORocgeQDAnLw,4297
|
10
|
-
smartpush/autotest/export/basic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
smartpush/get_jira_info/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
|
-
smartpush/get_jira_info/get_jira_info.py,sha256=zXp5OB9fVY5e0RbYcqlcq3ClqwLBAEvAVPZ1A_PrdMg,2416
|
13
|
-
smartpush-1.0.1.5.dist-info/METADATA,sha256=BSeazbrNM3oDxAVRkef2erJ6d5nXcv8aKdlqzGFEUq0,147
|
14
|
-
smartpush-1.0.1.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
15
|
-
smartpush-1.0.1.5.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
|
16
|
-
smartpush-1.0.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|