1
0
Fork 0
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:
Artur Maciag 2017-10-17 14:46:09 +01:00
parent 2491454c2a
commit b175da37e6
2 changed files with 17 additions and 1 deletions
tests/integration

View file

@ -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:

View file

@ -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