Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
interfaceTest
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李远洪
interfaceTest
Commits
66f77d0e
Commit
66f77d0e
authored
May 25, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了邮件标题不对的bug
parent
8abcc841
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
run.py
run.py
+0
-4
testCase/MainCase.py
testCase/MainCase.py
+2
-1
testCase/common/utils.py
testCase/common/utils.py
+2
-2
No files found.
run.py
View file @
66f77d0e
...
...
@@ -23,10 +23,6 @@ def txtRun():
###########################################################
def
runService
():
caseObj
=
MainCase
()
ts
=
time
.
time
()
timeArray
=
time
.
localtime
(
ts
)
curTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
caseObj
.
set_title
(
curTime
+
" 拨测报告"
)
# 设置邮件标题
caseObj
.
set_from_addr
(
"optest@vandyo.com"
)
# 设置发件箱
caseObj
.
set_password
(
"123qweQWE!@#AaA"
)
# 设置邮箱登录密码
caseObj
.
add_to_addr
(
"liyuanhong@vandyo.com"
)
# 添加收件箱
...
...
testCase/MainCase.py
View file @
66f77d0e
...
...
@@ -195,10 +195,11 @@ class MainCase():
def
sendEmail
(
self
):
email_obj
=
EmailTool
()
email_obj
.
addContent
(
self
.
msg
)
# 设置邮件内容
email_obj
.
set_title
(
self
.
title
)
# 设置邮件标题
ts
=
time
.
time
()
timeArray
=
time
.
localtime
(
ts
)
curTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
email_obj
.
set_title
(
curTime
+
" 拨测报告"
)
# 设置邮件标题
curDate
=
time
.
strftime
(
"
%
Y-
%
m-
%
d"
,
timeArray
)
time
.
sleep
(
2
)
email_obj
.
set_attachment
(
"result/"
+
curDate
+
"/"
+
self
.
testReport
,
self
.
testReport
)
# 设置附件
...
...
testCase/common/utils.py
View file @
66f77d0e
...
...
@@ -41,7 +41,7 @@ def getSignature(data,postData={}):
if
__name__
==
"__main__"
:
print
(
getSignature
({
"a"
:
123
,
"b"
:
"abc"
}))
print
(
getSignature
({
"sid"
:
"6d7b97627f4e4b8196a2e49731978b65"
,
"ts"
:
1590397597
,
"uid"
:
"bb4d91ccc1f6461daec7a0daf1c8e8f2"
}))
#
print(getSignature({"a":123,"b":"abc"}))
print
(
getSignature
({
'ts'
:
1590406665
,
'sid'
:
'31e07c4a44ac439dac8931aea3704c62'
,
'start'
:
1590406665
,
'uid'
:
'bb4d91ccc1f6461daec7a0daf1c8e8f2'
,
'cid'
:
'49a92ac0f9b14ba59d91ee8debe8357d'
}))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment