Ejemplo n.º 1
0
 def test_pickle_unity_object_exception(self):
     sa = tc.SArray()
     sf = tc.SFrame()
     g = tc.SGraph()
     sk = sa.summary()
     m = tc.pagerank.create(g)
     for obj in [sa, sf, g, sk, m]:
         self.assertRaises(PicklingError, lambda: cloudpickle.dumps(obj))
Ejemplo n.º 2
0
    def test_memoize_subclass(self):
        class A(object):
            def __init__(self):
                self.name = 'A'

        class B(A):
            def __init__(self):
                super(B, self).__init__()
                self.name2 = 'B'
        b = B()
        self.assertEqual(b.name, "A")
        self.assertEqual(b.name2, "B")

        b2 = pickle.loads(cloudpickle.dumps(b))
        self.assertEqual(b.name, b2.name)
        self.assertEqual(b.name2, b2.name2)