mirror of
https://github.com/correl/openapi-core.git
synced 2025-03-20 09:19:22 -09:00
Additional enum test
This commit is contained in:
parent
2491454c2a
commit
b175da37e6
2 changed files with 17 additions and 1 deletions
tests/integration
|
@ -112,6 +112,18 @@ components:
|
|||
type: string
|
||||
city:
|
||||
type: string
|
||||
Tag:
|
||||
type: string
|
||||
enum:
|
||||
- Cat
|
||||
- Dog
|
||||
- Bird
|
||||
Position:
|
||||
type: integer
|
||||
enum:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
Pet:
|
||||
type: object
|
||||
x-model: Pet
|
||||
|
@ -132,9 +144,11 @@ components:
|
|||
name:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
type: "#/components/schemas/Tag"
|
||||
address:
|
||||
$ref: "#/components/schemas/Address"
|
||||
position:
|
||||
$ref: "#/components/schemas/Position"
|
||||
Pets:
|
||||
type: array
|
||||
items:
|
||||
|
|
|
@ -230,6 +230,7 @@ class TestPetstore(object):
|
|||
data_json = {
|
||||
'name': pet_name,
|
||||
'tag': pet_tag,
|
||||
'position': '2',
|
||||
'address': {
|
||||
'street': pet_street,
|
||||
'city': pet_city,
|
||||
|
@ -254,6 +255,7 @@ class TestPetstore(object):
|
|||
assert body.__class__.__name__ == pet_model
|
||||
assert body.name == pet_name
|
||||
assert body.tag == pet_tag
|
||||
assert body.position == 2
|
||||
assert body.address.__class__.__name__ == address_model
|
||||
assert body.address.street == pet_street
|
||||
assert body.address.city == pet_city
|
||||
|
|
Loading…
Add table
Reference in a new issue