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
527fcdbb
Commit
527fcdbb
authored
Dec 12, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整个业务代码重构
parent
e6cb2a72
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
4 deletions
+67
-4
businesses_create.py
WorkApi/APP/Businesses/businesses_create.py
+1
-4
__init__.py
WorkCase/APP/__init__.py
+66
-0
No files found.
WorkApi/APP/Businesses/businesses_create.py
View file @
527fcdbb
...
...
@@ -54,8 +54,5 @@ class BusinessesCreate(object):
base
.
dict_add_key
(
_key
=
"memberid"
,
value
=
self
.
memberid
)
base
.
dict_add_key
(
_key
=
"hostids"
,
value
=
self
.
hostids
)
base
.
dict_add_key
(
_key
=
"serviceids"
,
value
=
self
.
serviceids
)
self
.
local_json
=
base
.
_json
self
.
_json
=
self
.
local_json
self
.
_json
=
base
.
_json
self
.
response
=
self
.
api
.
post
(
url
=
self
.
_url
,
headers
=
self
.
_headers
,
json
=
self
.
_json
)
WorkCase/APP/__init__.py
View file @
527fcdbb
...
...
@@ -3,6 +3,11 @@ from WorkApi.APP.Businesses.Type.businesses_type_create import BusinessesTypeCre
from
WorkApi.APP.Businesses.Type.businesses_type_delete
import
BusinessesTypeDelete
from
WorkApi.APP.Businesses.Type.businesses_type_get
import
BusinessesTypeGet
from
WorkApi.APP.Businesses.Type.businesses_type_update
import
BusinessesTypeUpdate
from
WorkApi.APP.Businesses.businesses_create
import
BusinessesCreate
from
WorkApi.APP.Businesses.businesses_delete
import
BusinessesDelete
from
WorkApi.APP.Businesses.businesses_get
import
BusinessesGet
from
WorkApi.APP.Businesses.businesses_tree
import
BusinessesTree
from
WorkApi.APP.Businesses.businesses_update
import
BusinessesUpdate
from
WorkApi.APP.Device.device_create
import
DeviceCreate
import
allure
...
...
@@ -64,6 +69,61 @@ class AppBase(object):
api
.
get_response
()
return
api
.
response
@allure.step
(
"调用接口:businesses.create"
)
def
businesses_create
(
self
,
token
=
None
,
name
=
None
,
description
=
None
,
_type
=
None
,
principalName
=
None
,
principalPhone
=
None
,
memberid
=
None
):
api
=
BusinessesCreate
(
_host
=
self
.
host
)
api
.
token
=
token
api
.
name
=
name
api
.
description
=
description
api
.
type
=
_type
api
.
principalName
=
principalName
api
.
principalPhone
=
principalPhone
api
.
memberid
=
memberid
api
.
get_response
()
return
api
.
response
@allure.step
(
"调用接口:businesses.delete"
)
def
businesses_delete
(
self
,
token
=
None
,
businessidList
=
None
):
api
=
BusinessesDelete
(
_host
=
self
.
host
)
api
.
token
=
token
api
.
businessidList
=
businessidList
api
.
get_response
()
return
api
.
response
@allure.step
(
"调用接口:businesses.get"
)
def
businesses_get
(
self
,
token
=
None
,
memberid
=
None
,
principal
=
None
,
_type
=
None
,
hostName
=
None
,
businessesName
=
None
):
api
=
BusinessesGet
(
_host
=
self
.
host
)
api
.
token
=
token
api
.
memberid
=
memberid
api
.
principal
=
principal
api
.
type
=
_type
api
.
hostName
=
hostName
api
.
businessesName
=
businessesName
api
.
get_response
()
return
api
.
response
@allure.step
(
"调用接口:businesses.update"
)
def
businesses_update
(
self
,
token
=
None
,
businessid
=
None
,
name
=
None
,
description
=
None
,
_type
=
None
,
principalName
=
None
,
principalPhone
=
None
,
memberid
=
None
):
api
=
BusinessesUpdate
(
_host
=
self
.
host
)
api
.
token
=
token
api
.
businessid
=
businessid
api
.
name
=
name
api
.
description
=
description
api
.
type
=
_type
api
.
principalName
=
principalName
api
.
principalPhone
=
principalPhone
api
.
memberid
=
memberid
api
.
get_response
()
return
api
.
response
@allure.step
(
"调用接口:businesses.tree"
)
def
businesses_tree
(
self
,
token
=
None
):
api
=
BusinessesTree
(
_host
=
self
.
host
)
api
.
token
=
token
api
.
get_response
()
return
api
.
response
@allure.step
(
"调用接口:device.create"
)
def
device_create
(
self
,
token
=
None
,
hostName
=
None
,
hostType
=
None
,
manageLevel
=
None
,
iplist
=
None
,
dns
=
None
,
monitorInterface
=
None
,
monitorType
=
None
,
parentHost
=
None
,
businessIds
=
None
,
...
...
@@ -148,6 +208,12 @@ class AppBase(object):
type_id
=
UtilsResponse
()
.
get_data
(
response
=
response
)
return
type_id
@allure.step
(
"创建测试数据"
)
def
case_create_businesses
(
self
,
name
,
_type
,
principalPhone
=
None
,
principalName
=
None
):
response
=
self
.
businesses_create
(
token
=
self
.
token
,
name
=
name
,
_type
=
_type
,
principalPhone
=
principalPhone
,
principalName
=
principalName
)
business_id
=
UtilsResponse
()
.
get_data
(
response
=
response
)
return
business_id
@allure.step
(
"断言返回结果"
)
def
check_code
(
self
,
response
,
code
):
_code
=
UtilsResponse
()
.
get_code
(
response
=
response
)
...
...
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