@@ -0,0 +1,1772 @@
+import six%0Aimport unittest%0Afrom PyAnalysisTools.base.Singleton import Singleton%0A%0A%0Aclass TestModule(unittest.TestCase):%0A    def setUp(self):%0A        pass%0A%0A    @unittest.skipIf(six.PY2, 'Python3 test running python2')%0A    def test_instance(self):%0A        class Foo(metaclass=Singleton):%0A            pass%0A        foo1 = Foo()%0A        foo2 = Foo()%0A        self.assertEqual(foo1, foo2)%0A%0A    @unittest.skipIf(six.PY2, 'Python3 test running python2')%0A    def test_instance_ctor(self):%0A        class Foo(metaclass=Singleton):%0A            def __init__(self, *args, **kwargs):%0A                self.args = args%0A                self.kwargs = kwargs%0A%0A        foo1 = Foo(1, foo='foo')%0A        foo2 = Foo(2, foo='bar')%0A        self.assertEqual(foo1, foo2)%0A        self.assertEqual(foo1.kwargs, %7B'foo': 'foo'%7D)%0A        self.assertEqual(foo1.args, (1,))%0A        self.assertEqual(foo2.kwargs, %7B'foo': 'foo'%7D)%0A        self.assertEqual(foo2.args, (1,))%0A%0A    @unittest.skipIf(six.PY3, 'Python2 test running python3')%0A    def test_instance_py2(self):%0A        class Foo(object):%0A            __metaclass__ = Singleton%0A            pass%0A%0A        foo1 = Foo()%0A        foo2 = Foo()%0A        self.assertEqual(foo1, foo2)%0A%0A    @unittest.skipIf(six.PY3, 'Python2 test running python3')%0A    def test_instance_ctor_py2(self):%0A        class Foo(object):%0A            __metaclass__ = Singleton%0A            def __init__(self, *args, **kwargs):%0A                self.args = args%0A                self.kwargs = kwargs%0A        foo1 = Foo(1, foo='foo')%0A        foo2 = Foo(2, foo='bar')%0A        self.assertEqual(foo1, foo2)%0A        self.assertEqual(foo1.kwargs, %7B'foo': 'foo'%7D)%0A        self.assertEqual(foo1.args, (1,))%0A        self.assertEqual(foo2.kwargs, %7B'foo': 'foo'%7D)%0A        self.assertEqual(foo2.args, (1,))%0A%0A

add singleton tests