Beispiel #1
0
 def test_deserialize(self):
     payload = Payload.deserialize(self.test_payload.serialize())
     fn_key, client_version, suppress_warnings, args, kwargs = payload['fn_key'], payload['client_version'], payload['suppress_warnings'], payload['args'], payload['kwargs']
     self.assertEqual(get_payload_function(fn_key), _fn)
     self.assertEqual(client_version, VERSION)
     self.assertEqual(set(args), set(('arg1',)))
     self.assertItemsEqual(kwargs, {'arg2': 'arg2value'})
     self.assertEqual(suppress_warnings, False)
Beispiel #2
0
 def test_get_payload_function_raises(self):
     with self.assertRaises(RuntimeError):
         get_payload_function(_function_key(_fn2))
Beispiel #3
0
 def test_get_payload_function_succeeds(self):
     self.assertEqual(_fn, get_payload_function(_function_key(_fn)))