def test_positive_for_normal_singleton_with_parameters(self):
    ' Positive test for @singleton with parameters provided for the constructor '
    try:

        class SampleDependencyInjection(object):
            pass
        sample_di = SampleDependencyInjection()

        @singleton(sample_di)
        class SuperDummyClass(TestDecoratorCommonSingletonClass.DummyTest):

            def __init__(self, dependency_injection):
                super(self.__class__, self).__init__()
                self.dependency_injection = dependency_injection
        self.assertTrue(True, 'Singleton Class: Passed the initialization as expected.')
    except SingletonInitializationException:
        self.assertTrue(False, 'Singleton Class: Failed the initialization with known exception.')
    self.assertIsInstance(SuperDummyClass.instance(), SuperDummyClass)
    SuperDummyClass.instance().take_action()
    self.assertEqual(SuperDummyClass.instance().get_number(), 1)
    SuperDummyClass.instance().take_action()
    self.assertEqual(SuperDummyClass.instance().get_number(), 2)
    self.assertIsInstance(SuperDummyClass.instance().dependency_injection, SampleDependencyInjection)
Positive test for @singleton with parameters provided for the constructor
def test_positive_for_normal_singleton_with_parameters(self):
    '  '
    try:

        class SampleDependencyInjection(object):
            pass
        sample_di = SampleDependencyInjection()

        @singleton(sample_di)
        class SuperDummyClass(TestDecoratorCommonSingletonClass.DummyTest):

            def __init__(self, dependency_injection):
                super(self.__class__, self).__init__()
                self.dependency_injection = dependency_injection
        self.assertTrue(True, 'Singleton Class: Passed the initialization as expected.')
    except SingletonInitializationException:
        self.assertTrue(False, 'Singleton Class: Failed the initialization with known exception.')
    self.assertIsInstance(SuperDummyClass.instance(), SuperDummyClass)
    SuperDummyClass.instance().take_action()
    self.assertEqual(SuperDummyClass.instance().get_number(), 1)
    SuperDummyClass.instance().take_action()
    self.assertEqual(SuperDummyClass.instance().get_number(), 2)
    self.assertIsInstance(SuperDummyClass.instance().dependency_injection, SampleDependencyInjection)