示例#1
0
 def test_conductor_entity(self, _):
     guestsz = gsz.ConductorGuestSerializer(None, self.key)
     hostsz = hsz.ConductorHostSerializer(None, None)
     encrypted_entity = guestsz.serialize_entity(self.context, self.data)
     self.assertNotEqual(encrypted_entity, self.data)
     entity = hostsz.deserialize_entity(self.context, encrypted_entity)
     self.assertEqual(entity, self.data)
示例#2
0
 def test_conductor_context(self, _):
     guestsz = gsz.ConductorGuestSerializer(None, self.key)
     hostsz = hsz.ConductorHostSerializer(None, None)
     encrypted_context = guestsz.serialize_context(self.context)
     self.assertNotEqual(encrypted_context, self.context)
     context = hostsz.deserialize_context(encrypted_context)
     self.assertEqual(context.get('instance_id'), self.uuid)
     context.pop('instance_id')
     self.assertDictEqual(context, self.context)
示例#3
0
 def test_hsz_serialize_context_nokey_noinstance(self, _):
     sz = hsz.ConductorHostSerializer(None, None)
     ctxt = FakeContext(instance_id=None)
     self.assertEqual(sz.serialize_context(ctxt), ctxt)