FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
openapi-core/tests/integration/conftest.py at master · python-openapi/openapi-core · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python-openapi
/
openapi-core
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
141
Star
369
Code
Issues
69
Pull requests
36
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
openapi-core
/
tests
/
integration
/
conftest.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
68 lines (49 loc) · 1.85 KB
Breadcrumbs
openapi-core
/
tests
/
integration
/
conftest.py
Copy path
File metadata and controls
68 lines (49 loc) · 1.85 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from
base64
import
b64decode
from
os
import
path
from
urllib
import
request
import
pytest
from
jsonschema_path
import
SchemaPath
from
openapi_spec_validator
.
readers
import
read_from_filename
from
yaml
import
safe_load
def
content_from_file
(
spec_file
):
directory
=
path
.
abspath
(
path
.
dirname
(
__file__
))
path_full
=
path
.
join
(
directory
,
spec_file
)
return
read_from_filename
(
path_full
)
def
schema_path_from_file
(
spec_file
):
spec_dict
,
base_uri
=
content_from_file
(
spec_file
)
return
SchemaPath
.
from_dict
(
spec_dict
,
base_uri
=
base_uri
)
def
schema_path_from_url
(
base_uri
):
content
=
request
.
urlopen
(
base_uri
)
spec_dict
=
safe_load
(
content
)
return
SchemaPath
.
from_dict
(
spec_dict
,
base_uri
=
base_uri
)
@
pytest
.
fixture
(
scope
=
"session"
)
def
data_gif
():
return
b64decode
(
"""
R0lGODlhEAAQAMQAAO3t7eHh4srKyvz8/P5pDP9rENLS0v/28P/17tXV1dHEvPDw8M3Nzfn5+d3d
3f5jA97Syvnv6MfLzcfHx/1mCPx4Kc/S1Pf189C+tP+xgv/k1N3OxfHy9NLV1/39/f///yH5BAAA
AAAALAAAAAAQABAAAAVq4CeOZGme6KhlSDoexdO6H0IUR+otwUYRkMDCUwIYJhLFTyGZJACAwQcg
EAQ4kVuEE2AIGAOPQQAQwXCfS8KQGAwMjIYIUSi03B7iJ+AcnmclHg4TAh0QDzIpCw4WGBUZeikD
Fzk0lpcjIQA7
"""
)
class
Factory
(
dict
):
__getattr__
=
dict
.
__getitem__
__setattr__
=
dict
.
__setitem__
@
pytest
.
fixture
(
scope
=
"session"
)
def
content_factory
():
return
Factory
(
from_file
=
content_from_file
,
)
@
pytest
.
fixture
(
scope
=
"session"
)
def
schema_path_factory
():
return
Factory
(
from_file
=
schema_path_from_file
,
from_url
=
schema_path_from_url
,
)
@
pytest
.
fixture
(
scope
=
"session"
)
def
v30_petstore_content
(
content_factory
):
content
,
_
=
content_factory
.
from_file
(
"data/v3.0/petstore.yaml"
)
return
content
@
pytest
.
fixture
(
scope
=
"session"
)
def
v30_petstore_spec
(
v30_petstore_content
):
base_uri
=
"file://tests/integration/data/v3.0/petstore.yaml"
return
SchemaPath
.
from_dict
(
v30_petstore_content
,
base_uri
=
base_uri
)
Back
|
FazBrowse Home
|
New Git URL