import copy

from test_simobj import BaseTestVectCalc, TestVectCalc


class MixinCopyTest(object):

    """
    Test that SimObject can be shallow-copied.
    """

    copyfunc = staticmethod(copy.copy)

    def new(self, simclass, *args, **kwds):
        self.orig_vc = super(MixinCopyTest, self).new(simclass, *args, **kwds)
        return self.copyfunc(self.orig_vc)


class TestCopyVectCalc(MixinCopyTest, TestVectCalc):
    pass


class MixinDeepCopyTest(MixinCopyTest):

    """
    Test that SimObject can be deep-copied.
    """

    copyfunc = staticmethod(copy.deepcopy)


class TestDeepCopyVectCalc(MixinDeepCopyTest, TestVectCalc):
    pass


class MixinTestCopyTest(object):

    """
    Test that mixin classes work.
    """

    def test(self):
        assert self.orig_vc is not self.vc


class TestCopyTest(MixinTestCopyTest, MixinCopyTest, BaseTestVectCalc):
    pass


class TestDeepCopyTest(MixinTestCopyTest, MixinDeepCopyTest, BaseTestVectCalc):
    pass

@@ -4,16 +4,41 @@
 ort copy
+%0Aimport cPickle as pickle
 %0A%0Afrom t
@@ -665,32 +665,286 @@
 lc):%0A    pass%0A%0A%0A
+class MixinPickleTest(MixinCopyTest):%0A%0A    %22%22%22%0A    Test that SimObject can be pickled.%0A    %22%22%22%0A%0A    @staticmethod%0A    def copyfunc(obj):%0A        return pickle.loads(pickle.dumps(obj))%0A%0A%0Aclass TestPickleVectCalc(MixinPickleTest, TestVectCalc):%0A    pass%0A%0A%0A
 class MixinTestC
@@ -1229,28 +1229,115 @@
 BaseTestVectCalc):%0A    pass%0A
+%0A%0Aclass TestPickleTest(MixinTestCopyTest, MixinPickleTest, BaseTestVectCalc):%0A    pass%0A

Add TestPickleVectCalc (7 errors)