Skip to content

Commit c40bd4d

Browse files
committed
AnyUnmarshaller use allOf schemas test
1 parent 95af369 commit c40bd4d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ components:
329329
message:
330330
type: string
331331
ExtendedError:
332+
type: object
332333
x-model: ExtendedError
333334
allOf:
334335
- $ref: "#/components/schemas/Error"

tests/unit/unmarshalling/test_unmarshal.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,23 @@ def test_schema_any_one_of(self, unmarshaller_factory):
466466
])
467467
assert unmarshaller_factory(schema)(['hello']) == ['hello']
468468

469+
def test_schema_any_all_of(self, unmarshaller_factory):
470+
schema = Schema(all_of=[
471+
Schema('array', items=Schema('string')),
472+
])
473+
assert unmarshaller_factory(schema)(['hello']) == ['hello']
474+
475+
def test_schema_any_all_of_any(self, unmarshaller_factory):
476+
schema = Schema(all_of=[
477+
Schema(),
478+
Schema('string', schema_format='date'),
479+
])
480+
value = '2018-01-02'
481+
482+
result = unmarshaller_factory(schema)(value)
483+
484+
assert result == datetime.date(2018, 1, 2)
485+
469486
def test_schema_any(self, unmarshaller_factory):
470487
schema = Schema()
471488
assert unmarshaller_factory(schema)('string') == 'string'

0 commit comments

Comments
 (0)