Skip to content

Commit

Permalink
ODM-12108: Update deserialization tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Kunitsyn committed Oct 7, 2024
1 parent 455b50f commit 5175067
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,18 @@ def test_deserialize_content_type(self):

deserialized = self.deserialize(response, "str", 'text/plain')
self.assertTrue(isinstance(deserialized, str))


deserialized = self.deserialize(response, "str", 'text/csv')
self.assertTrue(isinstance(deserialized, str))

deserialized = self.deserialize(response, "Dict[str, str]", 'APPLICATION/JSON')
self.assertTrue(isinstance(deserialized, dict))


with self.assertRaises(petstore_api.ApiException) as cm:
deserialized = self.deserialize(response, "str", 'text')

with self.assertRaises(petstore_api.ApiException) as cm:
deserialized = self.deserialize(response, "str", 'text/html')
deserialized = self.deserialize(response, "str", 'text/n0t-exist!ng')

with self.assertRaises(petstore_api.ApiException) as cm:
deserialized = self.deserialize(response, "Dict[str, str]", 'application/jsonnnnn')
Expand Down

0 comments on commit 5175067

Please sign in to comment.