summaryrefslogtreecommitdiff
path: root/tests/decorator_utils_test.py
blob: 68f1389cfa4895545cf0b7c7d25346807ae8c905 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3

# © Copyright 2021-2022, Scott Gasch

"""decorator_utils unittest such as it is."""

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()