From b5fe4d8c1a258d0c0464a19014ab461a87380f01 Mon Sep 17 00:00:00 2001 From: balancy Date: Tue, 3 Oct 2023 16:02:44 +0200 Subject: [PATCH] Add test for singleton pattern --- tests/test_chapter_05/test_singleton_pattern.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/test_chapter_05/test_singleton_pattern.py diff --git a/tests/test_chapter_05/test_singleton_pattern.py b/tests/test_chapter_05/test_singleton_pattern.py new file mode 100644 index 0000000..bf3dd2a --- /dev/null +++ b/tests/test_chapter_05/test_singleton_pattern.py @@ -0,0 +1,15 @@ +"""Module for testing pattern "Singleton".""" + + +from patterns.chapter_05_singleton.singleton import Singleton + + +def test_singleton() -> None: + """Test signleton pattern. + + Two created instances should be the same object. + """ + s1 = Singleton() + s2 = Singleton() + + assert str(s1) == str(s2)