Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zmops-test
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
sanshi
zmops-test
Commits
0b746091
Commit
0b746091
authored
Nov 25, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化pytest类
parent
90b1365a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
Administrator.xml
.idea/dictionaries/Administrator.xml
+2
-0
__init__.py
WorkCase/__init__.py
+1
-1
UtilsCmd.py
WorkUtils/UtilsCmd.py
+6
-2
UtilsPyTest.py
WorkUtils/UtilsPyTest.py
+3
-1
No files found.
.idea/dictionaries/Administrator.xml
View file @
0b746091
...
@@ -76,6 +76,7 @@
...
@@ -76,6 +76,7 @@
<w>
wechat
</w>
<w>
wechat
</w>
<w>
zabbix
</w>
<w>
zabbix
</w>
<w>
zmops
</w>
<w>
zmops
</w>
<w>
zmpos
</w>
</words>
</words>
</dictionary>
</dictionary>
</component>
</component>
\ No newline at end of file
WorkCase/__init__.py
View file @
0b746091
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
class
CaseBase
:
class
CaseBase
:
def
__init__
(
self
):
def
__init__
(
self
):
#
self.base_path = "D:\\TestZmpos\\WorkCase"
self
.
base_path
=
"D:
\\
TestZmpos
\\
WorkCase"
self
.
environment
=
{
self
.
environment
=
{
# "host": "http://10.0.0.12:7070",
# "host": "http://10.0.0.12:7070",
...
...
WorkUtils/UtilsCmd.py
View file @
0b746091
...
@@ -58,7 +58,7 @@ class UtilsCmd:
...
@@ -58,7 +58,7 @@ class UtilsCmd:
environment
=
None
environment
=
None
path
=
None
path
=
None
try
:
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"hv:e:p
;
"
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"hv:e:p
:
"
)
for
op
,
value
in
opts
:
for
op
,
value
in
opts
:
if
op
==
"-v"
:
if
op
==
"-v"
:
version
=
value
version
=
value
...
@@ -66,6 +66,7 @@ class UtilsCmd:
...
@@ -66,6 +66,7 @@ class UtilsCmd:
environment
=
value
environment
=
value
elif
op
==
"-p"
:
elif
op
==
"-p"
:
path
=
value
.
replace
(
"/"
,
"
\\
"
)
path
=
value
.
replace
(
"/"
,
"
\\
"
)
# path = value
elif
op
==
"-h"
:
elif
op
==
"-h"
:
# 帮助信息
# 帮助信息
self
.
usage
()
self
.
usage
()
...
@@ -75,8 +76,11 @@ class UtilsCmd:
...
@@ -75,8 +76,11 @@ class UtilsCmd:
except
getopt
.
GetoptError
as
e
:
except
getopt
.
GetoptError
as
e
:
self
.
log
.
error
(
"出现ERROR:"
)
self
.
log
.
error
(
"出现ERROR:"
)
self
.
log
.
error
(
e
)
self
.
log
.
error
(
e
)
return
{
_json
=
{
"version"
:
version
,
"version"
:
version
,
"environment"
:
environment
,
"environment"
:
environment
,
"path"
:
path
"path"
:
path
}
}
self
.
log
.
info
(
_json
)
return
_json
WorkUtils/UtilsPyTest.py
View file @
0b746091
...
@@ -11,6 +11,7 @@ import os
...
@@ -11,6 +11,7 @@ import os
from
datetime
import
datetime
from
datetime
import
datetime
from
WorkBase
import
WorkBase
from
WorkBase
import
WorkBase
from
WorkCase
import
CaseBase
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkUtils.UtilsLog
import
UtilsLog
...
@@ -29,6 +30,7 @@ class UtilsPyTest:
...
@@ -29,6 +30,7 @@ class UtilsPyTest:
self
.
case
=
case
self
.
case
=
case
self
.
version
=
self
.
case
[
"version"
]
self
.
version
=
self
.
case
[
"version"
]
self
.
case_path
=
CaseBase
()
.
base_path
self
.
case_info
=
case_info
self
.
case_info
=
case_info
self
.
xml_path
=
""
self
.
xml_path
=
""
...
@@ -51,7 +53,7 @@ class UtilsPyTest:
...
@@ -51,7 +53,7 @@ class UtilsPyTest:
self
.
xml_path
=
WorkBase
()
.
report_path
+
self
.
version
+
"
\\
"
+
str
(
self
.
case_name
)[
0
:
-
3
]
+
"
\\
"
+
self
.
create_time
+
"
\\
"
self
.
xml_path
=
WorkBase
()
.
report_path
+
self
.
version
+
"
\\
"
+
str
(
self
.
case_name
)[
0
:
-
3
]
+
"
\\
"
+
self
.
create_time
+
"
\\
"
else
:
else
:
self
.
log
.
debug
(
"多个用例文件运行模式"
)
self
.
log
.
debug
(
"多个用例文件运行模式"
)
self
.
case_name
=
self
.
case
[
"path"
]
self
.
case_name
=
self
.
case
_path
+
self
.
case
[
"path"
]
self
.
log
.
debug
(
"测试路径:
%
s"
%
self
.
case_name
)
self
.
log
.
debug
(
"测试路径:
%
s"
%
self
.
case_name
)
self
.
xml_path
=
WorkBase
()
.
report_path
+
self
.
version
+
"
\\
"
+
"Zmpos"
+
"
\\
"
+
self
.
create_time
+
"
\\
"
self
.
xml_path
=
WorkBase
()
.
report_path
+
self
.
version
+
"
\\
"
+
"Zmpos"
+
"
\\
"
+
self
.
create_time
+
"
\\
"
...
...
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