Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
Project
Project
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
邓莹莹
backend_auto
Commits
808e73ea
Commit
808e73ea
authored
Apr 16, 2021
by
邓莹莹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dyy_dev' into common_dev
parents
968ea294
c910900f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
5 deletions
+28
-5
接口yaml数据读取.png
.readme_images/接口yaml数据读取.png
+0
-0
account_request.py
all_backend_api/account_request.py
+3
-2
conftest.py
conftest.py
+2
-0
host.yaml
host.yaml
+1
-0
path_setting.py
path_setting.py
+1
-0
readme.md
readme.md
+11
-3
conftest.py
test_backend_case/conftest.py
+10
-0
No files found.
.readme_images/接口yaml数据读取.png
0 → 100644
View file @
808e73ea
273 KB
all_backend_api/account_request.py
View file @
808e73ea
...
@@ -4,7 +4,7 @@ from in_common.base_request import BaseRequest
...
@@ -4,7 +4,7 @@ from in_common.base_request import BaseRequest
class
account_request
(
BaseRequest
):
class
account_request
(
BaseRequest
):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
APYAML_CONFIG
)
self
.
loginvfc
=
self
.
api_load
(
path_setting
.
APYAML_CONFIG
)
def
login_vfc
(
self
,
current_city_id
,
phone_num
,
vfc_code
,
vfc_type
=
""
,
face_token
=
""
):
def
login_vfc
(
self
,
current_city_id
,
phone_num
,
vfc_code
,
vfc_type
=
""
,
face_token
=
""
):
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"current_city_id"
]
=
current_city_id
...
@@ -12,7 +12,8 @@ class account_request(BaseRequest):
...
@@ -12,7 +12,8 @@ class account_request(BaseRequest):
self
.
params
[
"vfc_code"
]
=
vfc_code
self
.
params
[
"vfc_code"
]
=
vfc_code
self
.
params
[
"vfc_type"
]
=
vfc_type
self
.
params
[
"vfc_type"
]
=
vfc_type
self
.
params
[
"face_token"
]
=
face_token
self
.
params
[
"face_token"
]
=
face_token
return
self
.
api_send
(
self
.
data
[
"login_vfc"
])
return
self
.
api_send
(
self
.
loginvfc
[
"login_vfc"
])
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
conftest.py
View file @
808e73ea
...
@@ -6,3 +6,5 @@ def pytest_collection_modifyitems(items):
...
@@ -6,3 +6,5 @@ def pytest_collection_modifyitems(items):
for
item
in
items
:
for
item
in
items
:
item
.
name
=
item
.
name
.
encode
(
"utf-8"
)
.
decode
(
"unicode_escape"
)
item
.
name
=
item
.
name
.
encode
(
"utf-8"
)
.
decode
(
"unicode_escape"
)
item
.
_nodeid
=
item
.
nodeid
.
encode
(
"utf-8"
)
.
decode
(
"unicode_escape"
)
item
.
_nodeid
=
item
.
nodeid
.
encode
(
"utf-8"
)
.
decode
(
"unicode_escape"
)
host.yaml
View file @
808e73ea
develop_host
:
develop_host
:
url
:
http://backend.paas-develop.env
url
:
http://backend.paas-develop.env
# url: http://doctor.paas-develop.env/
path_setting.py
View file @
808e73ea
...
@@ -4,6 +4,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
...
@@ -4,6 +4,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys
.
path
.
append
(
BASE_DIR
)
sys
.
path
.
append
(
BASE_DIR
)
HOSTYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto"
,
"host.yaml"
)
HOSTYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto"
,
"host.yaml"
)
APYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"account_request.yaml"
)
APYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"account_request.yaml"
)
LOGIN_VFC
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"login_vfc.yaml"
)
LOGIN_VFC
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"login_vfc.yaml"
)
...
...
readme.md
View file @
808e73ea
...
@@ -6,7 +6,9 @@
...
@@ -6,7 +6,9 @@
-
公共分支 common_dev
-
公共分支 common_dev
-
其他分支 参与项目的人每人创建一个已自己名字命名的分支,格式 dyy_dev
-
其他分支 参与项目的人每人创建一个已自己名字命名的分支,格式 dyy_dev
### 提交代码规范
### 提交代码及编写规范
-
!!!切记一,在本地写代码时,一定要再三确认是在自己的分支进行改动,不要在master分支修改
-
!!!切记二:提交代码,Git add时,不要添加in_common文件里面的文件,这个是公共方法,不能随意改动,如果本地误改动了,提交后,会影响整个流程
-
为了便于项目的管理维护,参与者可以将自己的代码确保运行成功的前提下,提交到自己分支,然后每周往commo_dev
-
为了便于项目的管理维护,参与者可以将自己的代码确保运行成功的前提下,提交到自己分支,然后每周往commo_dev
分支提交代码,负责人会将common_dev分支每周往master分支合并,参与者可每周一更新本地代码,确保自己的代码是最新的
分支提交代码,负责人会将common_dev分支每周往master分支合并,参与者可每周一更新本地代码,确保自己的代码是最新的
-
本地代码提交Git仓库时,避免已经上传的代码被覆盖,请Git push之前,先操作git pull,在本地解决好冲突后,再Git push
-
本地代码提交Git仓库时,避免已经上传的代码被覆盖,请Git push之前,先操作git pull,在本地解决好冲突后,再Git push
...
@@ -47,15 +49,21 @@
...
@@ -47,15 +49,21 @@
```
```


-
然后在account_request.yaml中写请求数据,结构如图
-
并且需要在该类中,读取path_setting路径中,配置的接口的yaml数据文件

-
然后在account_request.yaml中写接口请求数据(接口路径,传参),结构如图


-
然后写test_data,在test_backend_data目录下,找到account_data文件,创建yaml文件,yaml文件格式介绍,如图
-
然后写test_data,在test_backend_data目录下,找到account_data文件,创建yaml文件,yaml文件格式介绍,如图


-
将用例的路径放到path_setting.py下
-
将用例的路径放到path_setting.py下,这里面有2个路径需要放到里面,第一个是all_backend_api下创建的XXX_request.yaml文件
第二个是test_backend_case下创建的XXX.yaml文件


...
...
test_backend_case/conftest.py
0 → 100644
View file @
808e73ea
import
pytest
import
path_setting
@pytest.fixture
()
def
login
():
self
.
data
=
self
.
api_load
(
path_setting
.
APYAML_CONFIG
)
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