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
61849628
Commit
61849628
authored
Apr 16, 2021
by
林颖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
42c6066e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
0 deletions
+85
-0
diary_data_request.py
all_backend_api/diary_data_request.py
+24
-0
diary_data_request.yaml
all_backend_api/diary_data_request.yaml
+11
-0
path_setting.py
path_setting.py
+3
-0
run.py
run.py
+2
-0
test_diary_data.py
test_backend_case/account_case/test_diary_data.py
+26
-0
diary_data.yaml
test_backend_data/account_data/diary_data.yaml
+19
-0
No files found.
all_backend_api/diary_data_request.py
0 → 100644
View file @
61849628
from
backend_auto
import
path_setting
from
backend_auto.in_common.base_request
import
BaseRequest
class
diary_data_reqest
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
DIARY_DATA_CONFIG
)
def
diary_data
(
self
,
current_city_id
,
diary_referrer
,
sort
,
count
,
start_num
):
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"diary_referrer"
]
=
diary_referrer
self
.
params
[
"sort"
]
=
sort
self
.
params
[
"count"
]
=
count
self
.
params
[
"start_num"
]
=
start_num
return
self
.
api_send
(
self
.
data
[
"diary_data"
])
# if __name__ == '__main__':
# print(send_reqest().login_vfc("beijing", "+8612345678912", 1234, "", ""))
# print(send_reqest().diary_data("beijing", "my_diary", 0, 8, 2))
# print(1)
\ No newline at end of file
all_backend_api/diary_data_request.yaml
0 → 100644
View file @
61849628
diary_data
:
method
:
get
url
:
/api/diary/topic/15261339/_data
params
:
current_city_id
:
${current_city_id}
diary_referrer
:
${diary_referrer}
sort
:
${sort}
count
:
${count}
start_num
:
${start_num}
data
:
json
:
{}
path_setting.py
View file @
61849628
...
...
@@ -6,6 +6,9 @@ sys.path.append(BASE_DIR)
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"
)
LOGIN_VFC
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"login_vfc.yaml"
)
DIARY_DATA_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"diary_data_request.yaml"
)
DIARY_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"diary_data.yaml"
)
if
__name__
==
'__main__'
:
print
(
"=========="
,
HOSTYAML_CONFIG
)
run.py
View file @
61849628
from
test_backend_case.account_case
import
test_login_vfc
from
test_backend_case.account_case
import
test_diary_data
import
pytest
...
...
test_backend_case/account_case/test_diary_data.py
0 → 100644
View file @
61849628
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.diary_data_request
import
diary_data_reqest
class
TestDIARYDATA
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_DATA
)
diary_data_case
,
diary_data_data
=
get_ids
(
data
,
"diary_data"
)
@pytest.mark.parametrize
(
"param"
,
diary_data_data
,
ids
=
diary_data_case
)
def
test_diary_data
(
self
,
param
):
print
(
2
)
r
=
diary_data_reqest
()
.
diary_data
(
param
[
"current_city_id"
],
param
[
"diary_referrer"
],
param
[
"sort"
],
param
[
"count"
],
param
[
"start_num"
])
print
(
1
)
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
# assert(r[""])
if
r
[
"error"
]
==
1
:
assert
r
[
"error"
]
==
param
[
"assert"
]
test_backend_data/account_data/diary_data.yaml
0 → 100644
View file @
61849628
diary_data
:
#字段正常case
-
case
:
"
接口正常case"
current_city_id
:
"
beijing"
diary_referrer
:
"
my_diary"
sort
:
0
count
:
8
start_num
:
2
assert
:
0
-
case
:
"
接口失败case"
current_city_id
:
"
beijing"
diary_referrer
:
"
my_diary"
sort
:
0
count
:
8
start_num
:
2
assert
:
1
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