Fix serializer tests
The serializer tests occasionally fail since the order of a dict() is not guaranteed. Explicitly compute the serializer instead of pre-computing it. Change-Id: I74f8fa227e6508491b5982fe7e2841683724540c
This commit is contained in:
parent
8b44bfd538
commit
1642071feb
@ -348,13 +348,13 @@ class TestSerializer(test_utils.BaseTestCase):
|
||||
serializer.deserialize_entity = mock.Mock()
|
||||
serializer.serialize_context = mock.Mock()
|
||||
|
||||
def _stub(ctxt, arg):
|
||||
return 's' + arg
|
||||
|
||||
msg = dict(method='foo', args=dict())
|
||||
expected_side_effect = []
|
||||
for k, v in self.args.items():
|
||||
msg['args'][k] = 's' + v
|
||||
expected_side_effect.append('s' + v)
|
||||
|
||||
serializer.serialize_entity.side_effect = expected_side_effect
|
||||
serializer.serialize_entity.side_effect = _stub
|
||||
|
||||
if self.call:
|
||||
serializer.deserialize_entity.return_value = 'd' + self.retval
|
||||
|
Loading…
Reference in New Issue
Block a user