55
66from openapi_core import Config
77from openapi_core import OpenAPI
8+ from openapi_core import V30ResponseUnmarshaller
89from openapi_core .testing import MockRequest
910from openapi_core .testing import MockResponse
1011
@@ -13,6 +14,13 @@ class TestParentReference:
1314
1415 spec_path = "data/v3.0/parent-reference/openapi.yaml"
1516
17+ @pytest .fixture
18+ def unmarshaller (self , content_factory ):
19+ content , base_uri = content_factory .from_file (self .spec_path )
20+ return V30ResponseUnmarshaller (
21+ spec = SchemaPath .from_dict (content , base_uri = base_uri )
22+ )
23+
1624 @pytest .fixture
1725 def openapi (self , content_factory ):
1826 content , base_uri = content_factory .from_file (self .spec_path )
@@ -27,3 +35,11 @@ def test_valid(self, openapi):
2735 )
2836
2937 openapi .validate_response (request , response )
38+
39+ def test_unmarshal (self , unmarshaller ):
40+ request = MockRequest (host_url = "" , method = "GET" , path = "/books" )
41+ response = MockResponse (
42+ data = json .dumps ([{"id" : "BOOK:01" , "title" : "Test Book" }]).encode ()
43+ )
44+
45+ unmarshaller .unmarshal (request , response )
0 commit comments