Skip to content

Commit b175da3

Browse files
committed
Additional enum test
1 parent 2491454 commit b175da3

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

tests/integration/data/v3.0/petstore.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ components:
112112
type: string
113113
city:
114114
type: string
115+
Tag:
116+
type: string
117+
enum:
118+
- Cat
119+
- Dog
120+
- Bird
121+
Position:
122+
type: integer
123+
enum:
124+
- 1
125+
- 2
126+
- 3
115127
Pet:
116128
type: object
117129
x-model: Pet
@@ -132,9 +144,11 @@ components:
132144
name:
133145
type: string
134146
tag:
135-
type: string
147+
type: "#/components/schemas/Tag"
136148
address:
137149
$ref: "#/components/schemas/Address"
150+
position:
151+
$ref: "#/components/schemas/Position"
138152
Pets:
139153
type: array
140154
items:

tests/integration/test_petstore.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def test_post_pets(self, spec, spec_dict):
230230
data_json = {
231231
'name': pet_name,
232232
'tag': pet_tag,
233+
'position': '2',
233234
'address': {
234235
'street': pet_street,
235236
'city': pet_city,
@@ -254,6 +255,7 @@ def test_post_pets(self, spec, spec_dict):
254255
assert body.__class__.__name__ == pet_model
255256
assert body.name == pet_name
256257
assert body.tag == pet_tag
258+
assert body.position == 2
257259
assert body.address.__class__.__name__ == address_model
258260
assert body.address.street == pet_street
259261
assert body.address.city == pet_city

0 commit comments

Comments
 (0)