def test_pickle(self): m = self.cls() self.assertNode(m) pickled = _pickle_loads(_pickle_dumps(m)) self.assertNode(pickled) self.assertEqual(len(pickled), 0) for i in range(6): pickled[i] = chr(i) self.assertNode(pickled) pickled = _pickle_loads(_pickle_dumps(pickled)) self.assertNode(pickled) self.assertEqual(len(pickled), i + 1) for j in range(i): self.assertEqual(chr(j), pickled[j])
def test_pickle(self): s = self.cls() self.assertNode(s) pickled = _pickle_loads(_pickle_dumps(s)) self.assertNode(pickled) self.assertEqual(len(pickled), 0) for i in range(6): pickled.add(i) self.assertNode(pickled) pickled = _pickle_loads(_pickle_dumps(pickled)) self.assertNode(pickled) self.assertEqual(len(pickled), i + 1) for j in range(i): self.assertEqual(j, pickled.get(j))
def test_pickle(self): t = self.cls() self.assertNode(t) pickled = _pickle_loads(_pickle_dumps(t)) self.assertNode(pickled) self.assertEqual(len(pickled), 0) for i in range(6): pickled._set(i, chr(i)) self.assertNode(pickled) pickled = _pickle_loads(_pickle_dumps(pickled)) self.assertNode(pickled) self.assertEqual(len(pickled), i + 1) for j in range(i): self.assertEqual(chr(j), pickled.get(j))