@@ -74,6 +74,7 @@ def test_mapping_request_serialization(self):
74
74
headers = {"Accept" : "stuff" },
75
75
query_parameters = {"param" : "1" },
76
76
body_patterns = {"test" : "test2" },
77
+ metadata = {'key' : 'value' }
77
78
)
78
79
serialized = e .get_json_data ()
79
80
self .assertDictContainsKeyWithValue (serialized , "method" , "GET" )
@@ -86,6 +87,7 @@ def test_mapping_request_serialization(self):
86
87
self .assertDictContainsKeyWithValue (serialized , "headers" , {"Accept" : "stuff" })
87
88
self .assertDictContainsKeyWithValue (serialized , "queryParameters" , {"param" : "1" })
88
89
self .assertDictContainsKeyWithValue (serialized , "bodyPatterns" , {"test" : "test2" })
90
+ self .assertDictContainsKeyWithValue (serialized , "metadata" , {"key" : "value" })
89
91
90
92
@attr ("unit" , "serialization" , "mappings" )
91
93
def test_mapping_request_deserialization (self ):
@@ -100,6 +102,7 @@ def test_mapping_request_deserialization(self):
100
102
"headers" : {"Accept" : "stuff" },
101
103
"queryParameters" : {"param" : "1" },
102
104
"bodyPatterns" : {"test" : "test2" },
105
+ 'metadata' : {'key' : [1 , 2 , 3 ]},
103
106
}
104
107
e = MappingRequest .from_dict (serialized )
105
108
self .assertIsInstance (e , MappingRequest )
@@ -115,6 +118,7 @@ def test_mapping_request_deserialization(self):
115
118
self .assertEquals ({"Accept" : "stuff" }, e .headers )
116
119
self .assertEquals ({"param" : "1" }, e .query_parameters )
117
120
self .assertEquals ({"test" : "test2" }, e .body_patterns )
121
+ self .assertEquals ({"key" : [1 , 2 , 3 ]}, e .metadata )
118
122
119
123
@attr ("unit" , "serialization" , "mappings" )
120
124
def test_mapping_response_serialization (self ):
@@ -241,14 +245,14 @@ def test_mapping_deserialization(self):
241
245
242
246
@attr ("unit" , "serialization" , "mappings" )
243
247
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 ))
245
249
serialized = e .get_json_data ()
246
- self .assertDictContainsKeyWithValue (serialized , "mappings" , [{"priority" : 1 },])
250
+ self .assertDictContainsKeyWithValue (serialized , "mappings" , [{"priority" : 1 }, ])
247
251
self .assertDictContainsKeyWithValue (serialized , "meta" , {"total" : 1 })
248
252
249
253
@attr ("unit" , "serialization" , "mappings" )
250
254
def test_all_mappings_deserialization (self ):
251
- serialized = {"mappings" : [{"priority" : 1 },], "meta" : {"total" : 1 }}
255
+ serialized = {"mappings" : [{"priority" : 1 }, ], "meta" : {"total" : 1 }}
252
256
e = AllMappings .from_dict (serialized )
253
257
self .assertIsInstance (e , AllMappings )
254
258
self .assertIsInstance (e .mappings , list )
0 commit comments