@@ -74,6 +74,7 @@ def test_mapping_request_serialization(self):
7474 headers = {"Accept" : "stuff" },
7575 query_parameters = {"param" : "1" },
7676 body_patterns = {"test" : "test2" },
77+ metadata = {'key' : 'value' }
7778 )
7879 serialized = e .get_json_data ()
7980 self .assertDictContainsKeyWithValue (serialized , "method" , "GET" )
@@ -86,6 +87,7 @@ def test_mapping_request_serialization(self):
8687 self .assertDictContainsKeyWithValue (serialized , "headers" , {"Accept" : "stuff" })
8788 self .assertDictContainsKeyWithValue (serialized , "queryParameters" , {"param" : "1" })
8889 self .assertDictContainsKeyWithValue (serialized , "bodyPatterns" , {"test" : "test2" })
90+ self .assertDictContainsKeyWithValue (serialized , "metadata" , {"key" : "value" })
8991
9092 @attr ("unit" , "serialization" , "mappings" )
9193 def test_mapping_request_deserialization (self ):
@@ -100,6 +102,7 @@ def test_mapping_request_deserialization(self):
100102 "headers" : {"Accept" : "stuff" },
101103 "queryParameters" : {"param" : "1" },
102104 "bodyPatterns" : {"test" : "test2" },
105+ 'metadata' : {'key' : [1 , 2 , 3 ]},
103106 }
104107 e = MappingRequest .from_dict (serialized )
105108 self .assertIsInstance (e , MappingRequest )
@@ -115,6 +118,7 @@ def test_mapping_request_deserialization(self):
115118 self .assertEquals ({"Accept" : "stuff" }, e .headers )
116119 self .assertEquals ({"param" : "1" }, e .query_parameters )
117120 self .assertEquals ({"test" : "test2" }, e .body_patterns )
121+ self .assertEquals ({"key" : [1 , 2 , 3 ]}, e .metadata )
118122
119123 @attr ("unit" , "serialization" , "mappings" )
120124 def test_mapping_response_serialization (self ):
@@ -241,14 +245,14 @@ def test_mapping_deserialization(self):
241245
242246 @attr ("unit" , "serialization" , "mappings" )
243247 def test_all_mappings_serialization (self ):
244- e = AllMappings (mappings = [Mapping (priority = 1 ),], meta = MappingMeta (total = 1 ))
248+ e = AllMappings (mappings = [Mapping (priority = 1 ), ], meta = MappingMeta (total = 1 ))
245249 serialized = e .get_json_data ()
246- self .assertDictContainsKeyWithValue (serialized , "mappings" , [{"priority" : 1 },])
250+ self .assertDictContainsKeyWithValue (serialized , "mappings" , [{"priority" : 1 }, ])
247251 self .assertDictContainsKeyWithValue (serialized , "meta" , {"total" : 1 })
248252
249253 @attr ("unit" , "serialization" , "mappings" )
250254 def test_all_mappings_deserialization (self ):
251- serialized = {"mappings" : [{"priority" : 1 },], "meta" : {"total" : 1 }}
255+ serialized = {"mappings" : [{"priority" : 1 }, ], "meta" : {"total" : 1 }}
252256 e = AllMappings .from_dict (serialized )
253257 self .assertIsInstance (e , AllMappings )
254258 self .assertIsInstance (e .mappings , list )
0 commit comments