Persistent state.
[python_utils.git] / tests / decorator_utils_test.py
diff --git a/tests/decorator_utils_test.py b/tests/decorator_utils_test.py
new file mode 100755 (executable)
index 0000000..195dd63
--- /dev/null
@@ -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()