From c46018e2b1ddc78f9df557c3fb24d2c2c849f054 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Tue, 21 Sep 2021 18:25:50 -0700 Subject: Persistent state. --- tests/decorator_utils_test.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tests/decorator_utils_test.py (limited to 'tests') 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() -- cgit v1.3