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
77ad34ef
Commit
77ad34ef
authored
Jul 14, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 项目百科百科详情页
parent
5ea5a5f8
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
75 additions
and
47 deletions
+75
-47
hybrid_request.py
all_backend_api/hybrid_request.py
+3
-11
hybrid_request.yaml
all_backend_api/hybrid_request.yaml
+0
-10
wiki_request.py
all_backend_api/wiki_request.py
+26
-0
wiki_request.yaml
all_backend_api/wiki_request.yaml
+15
-0
path_setting.py
path_setting.py
+2
-2
test_basewiki_item.py
test_backend_case/hybrid_case/test_basewiki_item.py
+0
-20
__init__.py
test_backend_case/wiki_case/__init__.py
+0
-0
test_wiki_item.py
test_backend_case/wiki_case/test_wiki_item.py
+21
-0
topic_reply_create.yaml
test_backend_data/topic_data/topic_reply_create.yaml
+1
-1
__init__.py
test_backend_data/wiki_data/__init__.py
+0
-0
wiki_item.yaml
test_backend_data/wiki_data/wiki_item.yaml
+7
-3
No files found.
all_backend_api/hybrid_request.py
View file @
77ad34ef
...
...
@@ -7,8 +7,6 @@ class hybrid_request(BaseRequest):
def
__init__
(
self
):
#百科详情页-项目聚合百科
self
.
data
=
self
.
api_load
(
path_setting
.
SUBWIKI_CONFIG
)
#百科详情页-项目百科
self
.
data
=
self
.
api_load
(
path_setting
.
BASEWIKI_ITEM_CONFIG
)
#百科详情页-药品(仪器、材料)百科
self
.
data
=
self
.
api_load
(
path_setting
.
BASEWIKI_PRODUCT_CONFIG
)
#百科详情页-品牌百科
...
...
@@ -23,12 +21,6 @@ class hybrid_request(BaseRequest):
return
self
.
api_send
(
self
.
data
[
'sub_wiki'
])
# return self.data
#百科详情页-项目百科
def
basewiki_item
(
self
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
'version'
]
=
version
return
self
.
api_send
(
self
.
data
[
'basewiki_item'
])
#百科详情页-药品(仪器、材料)百科
def
basewiki_product
(
self
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
'version'
]
=
version
...
...
@@ -67,7 +59,7 @@ class hybrid_request(BaseRequest):
if
__name__
==
'__main__'
:
# print(self.data)
# print(hybrid_request().sub_wiki("744.0", "beijing"))
#
print(type(hybrid_request().sub_wiki("744.0", "beijing")))
print
(
type
(
hybrid_request
()
.
sub_wiki
(
"744.0"
,
"beijing"
)))
soup
=
BeautifulSoup
(
hybrid_request
()
.
sub_wiki
(
"744.0"
,
"beijing"
),
'lxml'
)
# html.parser是解析器,也可是lxml
print
(
soup
.
prettify
(),
'百科详情页-项目聚合百科'
)
#输出soup对象的内容
print
(
soup
.
title
)
\ No newline at end of file
# print(soup.title)
\ No newline at end of file
all_backend_api/hybrid_request.yaml
View file @
77ad34ef
...
...
@@ -9,16 +9,6 @@ sub_wiki:
data
:
{}
json
:
{}
#百科详情页-项目百科-水光针
basewiki_item
:
method
:
GET
url
:
/hybrid/base_wiki/item/141
params
:
version
:
${version}
data
:
{}
json
:
{}
#百科详情页-药品(仪器、材料)百科-菲洛嘉
basewiki_product
:
method
:
GET
...
...
all_backend_api/wiki_request.py
0 → 100644
View file @
77ad34ef
import
path_setting
from
in_common.base_request
import
BaseRequest
from
bs4
import
BeautifulSoup
class
wiki_request
(
BaseRequest
):
def
__init__
(
self
):
#百科详情页-项目百科
self
.
data
=
self
.
api_load
(
path_setting
.
WIKI_ITEM_CONFIG
)
#百科详情页-项目百科
def
wiki_item
(
self
,
tag_ids
,
q
,
start_num
,
version
,
device_id
):
self
.
params
[
'tag_ids'
]
=
tag_ids
self
.
params
[
'q'
]
=
q
self
.
params
[
'start_num'
]
=
start_num
self
.
params
[
'version'
]
=
version
self
.
params
[
'device_id'
]
=
device_id
return
self
.
api_send
(
self
.
data
[
'wiki_item'
])
if
__name__
==
'__main__'
:
print
(
type
(
wiki_request
()
.
wiki_item
(
"2059"
,
"水光针"
,
"0"
,
"7.46.0"
,
"97B6764B-2135-4761-9911-701C38CBC272"
)))
# soup = BeautifulSoup(hybrid_request().sub_wiki("744.0", "beijing"), 'lxml') # html.parser是解析器,也可是lxml
# print(soup.prettify(),'百科详情页-项目聚合百科') #输出soup对象的内容
# print(soup.title)
\ No newline at end of file
all_backend_api/wiki_request.yaml
0 → 100644
View file @
77ad34ef
#百科详情页-项目百科-水光针
wiki_item
:
method
:
GET
url
:
/api/wiki/item/141/
params
:
tag_ids
:
${tag_ids}
q
:
${q}
start_num
:
${start_num}
version
:
${version}
device_id
:
${device_id}
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
77ad34ef
...
...
@@ -455,8 +455,8 @@ SUBWIKI_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_
SUBWIKI
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hybrid_data"
,
"sub_wiki.yaml"
)
#百科详情页-项目百科
BASEWIKI_ITEM_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"hybrid
_request.yaml"
)
BASEWIKI_ITEM
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hybrid_data"
,
"base
wiki_item.yaml"
)
WIKI_ITEM_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"wiki
_request.yaml"
)
WIKI_ITEM
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/wiki_data"
,
"
wiki_item.yaml"
)
#百科详情页-药品(仪器、材料)百科
BASEWIKI_PRODUCT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"hybrid_request.yaml"
)
...
...
test_backend_case/hybrid_case/test_basewiki_item.py
deleted
100644 → 0
View file @
5ea5a5f8
import
pytest
from
bs4
import
BeautifulSoup
import
path_setting
from
all_backend_api.hybrid_request
import
hybrid_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
#百科详情页-项目百科,水光针
class
TestBaseWikiItem
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
BASEWIKI_ITEM
)
basewiki_item_case
,
basewiki_item_data
=
get_ids
(
data
,
"basewiki_item"
)
@pytest.mark.parametrize
(
"param"
,
basewiki_item_data
,
ids
=
basewiki_item_case
)
def
test_basewiki_item
(
self
,
param
):
r
=
hybrid_request
()
.
basewiki_item
(
param
[
"version"
])
soup
=
BeautifulSoup
(
r
,
'lxml'
)
# html.parser是解析器,也可是lxml
assert
soup
.
title
.
string
==
param
[
"assert"
]
print
(
'进入项目百科-水光针的百科详情页'
)
\ No newline at end of file
test_backend_case/wiki_case/__init__.py
0 → 100644
View file @
77ad34ef
test_backend_case/wiki_case/test_wiki_item.py
0 → 100644
View file @
77ad34ef
import
pytest
from
bs4
import
BeautifulSoup
import
path_setting
from
all_backend_api.wiki_request
import
wiki_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
#百科详情页-项目百科,水光针
class
TestWikiItem
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
WIKI_ITEM
)
wiki_item_case
,
wiki_item_data
=
get_ids
(
data
,
"wiki_item"
)
@pytest.mark.parametrize
(
"param"
,
wiki_item_data
,
ids
=
wiki_item_case
)
def
test_wiki_item
(
self
,
param
):
r
=
wiki_request
()
.
wiki_item
(
param
[
"tag_ids"
],
param
[
"q"
],
param
[
"start_num"
],
param
[
"version"
],
param
[
"device_id"
])
# soup = BeautifulSoup(r, 'lxml') # html.parser是解析器,也可是lxml
if
r
[
"data"
]
is
True
:
assert
r
[
"data"
][
"item_id"
]
==
param
[
"assert"
]
print
(
'进入项目百科-水光针的百科详情页'
)
\ No newline at end of file
test_backend_data/topic_data/topic_reply_create.yaml
View file @
77ad34ef
...
...
@@ -3,7 +3,7 @@ reply_create:
beuzhu
:
'
#
备注:
这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case
:
日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel
:
benzhan
content
:
ces测试+2021-07-
09 18:49:02
content
:
ces测试+2021-07-
14 18:15:39
message
:
请勿回复重复内容
message1
:
回复成功
message2
:
你的回复有点频繁,稍后再来
...
...
test_backend_data/wiki_data/__init__.py
0 → 100644
View file @
77ad34ef
test_backend_data/
hybrid_data/base
wiki_item.yaml
→
test_backend_data/
wiki_data/
wiki_item.yaml
View file @
77ad34ef
base
wiki_item
:
wiki_item
:
-
#百科详情页-项目百科,水光针
case
:
"
百科详情页-项目百科,水光针"
tag_ids
:
"
2059"
q
:
"
水光针"
start_num
:
"
0"
version
:
"
744.0"
assert
:
水光针
\ No newline at end of file
device_id
:
"
97B6764B-2135-4761-9911-701C38CBC272"
assert
:
141
\ No newline at end of file
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