Skip to content

Commit

Permalink
Add test for singleton pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
balancy committed Oct 3, 2023
1 parent 614f5cf commit b5fe4d8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_chapter_05/test_singleton_pattern.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit b5fe4d8

Please sign in to comment.