Example #1
0
 def test_state2object(self):
     "Test if we can convert a state to an object."
     f = Foo()
     str = dumps(f)
     st = spickle.get_state(f)
     g = spickle.state2object(st)
     self._test_object(g)
Example #2
0
 def test_dump_state(self):
     "Test if we are able to dump the state to a string."
     f = Foo()
     str = dumps(f)
     st = spickle.get_state(f)
     str1 = spickle.dumps_state(st)
     self.assertEqual(str, str1)
     st = spickle.loads_state(str)
     self.assertEqual(str, spickle.dumps_state(st))