X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=tests%2Fdecorator_utils_test.py;fp=tests%2Fdecorator_utils_test.py;h=195dd636a6a2238ad5df9e23d6caf7f841a0353d;hb=c46018e2b1ddc78f9df557c3fb24d2c2c849f054;hp=0000000000000000000000000000000000000000;hpb=946279b8b220d9dffe3b47b3bda8ba9e48ccb25a;p=python_utils.git diff --git a/tests/decorator_utils_test.py b/tests/decorator_utils_test.py new file mode 100755 index 0000000..195dd63 --- /dev/null +++ b/tests/decorator_utils_test.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +import unittest + +import decorator_utils as du + +import unittest_utils as uu + + +class TestDecorators(unittest.TestCase): + + def test_singleton(self): + + @du.singleton + class FooBar(): + pass + + x = FooBar() + y = FooBar() + self.assertTrue(x is y) + + +if __name__ == '__main__': + unittest.main()