def test_positive_for_singleton_with(self):
    ' Positive test for @singleton_with(*args, **kwargs) '
    try:

        class SampleDependencyInjection(object):
            pass

        @singleton_with(SampleDependencyInjection)
        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(*args, **kwargs)
def test_positive_for_singleton_with(self):
    '  '
    try:

        class SampleDependencyInjection(object):
            pass

        @singleton_with(SampleDependencyInjection)
        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)