# Path: src/singleton/singleton_classical.py
# class ClassicalSingleton(object):
#     """
#     Singleton class based on overriding the __new__ method
#     """
# 
#     def __new__(cls):
#         """
#         Override __new__ method to control the obj. creation
#         :return: Singleton obj.
#         """
#         if not hasattr(cls, 'instance'):
#             cls.instance = super(ClassicalSingleton, cls).__new__(cls)
# 
#         return cls.instance
# 
#     @staticmethod
#     def get_driver():
#         """
# 
#         :return: Selenium driver
#         """
#         return webdriver.Chrome()


from unittest import TestCase
from src.singleton.singleton_classical import ClassicalSingleton
"""
Description:
    - Check the object instance memory location

@author: Paul Bodean
@date: 26/12/2017
"""



class TestSingleton(TestCase):
    def test_singleton(self):
        s = ClassicalSingleton()

# Path: src/singleton/singleton_classical.py
# class ClassicalSingleton(object):
#     """
#     Singleton class based on overriding the __new__ method
#     """
# 
#     def __new__(cls):
#         """
#         Override __new__ method to control the obj. creation
#         :return: Singleton obj.
#         """
#         if not hasattr(cls, 'instance'):
#             cls.instance = super(ClassicalSingleton, cls).__new__(cls)
# 
#         return cls.instance
# 
#     @staticmethod
#     def get_driver():
#         """
# 
#         :return: Selenium driver
#         """
#         return webdriver.Chrome()


# Path: tests/singleton/test_singleton_classical.py
from unittest import TestCase
from src.singleton.singleton_classical import ClassicalSingleton

"""
Description:
    - Check the object instance memory location

@author: Paul Bodean
@date: 26/12/2017
"""



class TestSingleton(TestCase):
    def test_singleton(self):
        s = ClassicalSingleton()

        d = ClassicalSingleton()