forked from loafle/openapi-generator-original
update and fix python samples (#489)
* fix: update petstore samples for python, fix broken tests * chore: entries for python-asyncio/tornado in gitignore
This commit is contained in:
committed by
William Cheng
parent
950c584485
commit
96e86ac03e
@@ -52,7 +52,6 @@ class MapTestTests(unittest.TestCase):
|
||||
except ValueError:
|
||||
self.assertTrue(1)
|
||||
|
||||
|
||||
def test_maptest_setter(self):
|
||||
#
|
||||
# Check with some valid values
|
||||
@@ -65,7 +64,6 @@ class MapTestTests(unittest.TestCase):
|
||||
map_enum_test.map_of_enum_string = up_or_low_dict
|
||||
self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
|
||||
|
||||
|
||||
#
|
||||
# Check if the setter fails for invalid enum values
|
||||
#
|
||||
@@ -79,7 +77,6 @@ class MapTestTests(unittest.TestCase):
|
||||
except ValueError:
|
||||
self.assertEqual(map_enum_test.map_of_enum_string, None)
|
||||
|
||||
|
||||
def test_todict(self):
|
||||
#
|
||||
# Check dictionary serialization
|
||||
@@ -94,15 +91,27 @@ class MapTestTests(unittest.TestCase):
|
||||
'valText': "Text",
|
||||
'valueDict': up_or_low_dict
|
||||
}
|
||||
indirect_map = {
|
||||
'option1': True
|
||||
}
|
||||
direct_map = {
|
||||
'option2': False
|
||||
}
|
||||
map_enum_test.map_of_enum_string = up_or_low_dict
|
||||
map_enum_test.map_map_of_string = map_of_map_of_strings
|
||||
|
||||
map_enum_test.indirect_map = indirect_map
|
||||
map_enum_test.direct_map = direct_map
|
||||
|
||||
self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
|
||||
self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings)
|
||||
self.assertEqual(map_enum_test.indirect_map, indirect_map)
|
||||
self.assertEqual(map_enum_test.direct_map, direct_map)
|
||||
|
||||
expected_dict = {
|
||||
'map_of_enum_string': up_or_low_dict,
|
||||
'map_map_of_string': map_of_map_of_strings
|
||||
'map_map_of_string': map_of_map_of_strings,
|
||||
'indirect_map': indirect_map,
|
||||
'direct_map': direct_map
|
||||
}
|
||||
|
||||
self.assertEqual(map_enum_test.to_dict(), expected_dict)
|
||||
|
||||
Reference in New Issue
Block a user