Esempio n. 1
0
    def test_same_instance(self):
        """
        Test that the providers dict is still the same instance.

        """
        providers = syringe._PROVIDERS
        syringe.clear()
        self.assertIs(providers, syringe._PROVIDERS)
    def test_same_instance(self):
        """
        Test that the providers dict is still the same instance.

        """
        providers = syringe._PROVIDERS
        syringe.clear()
        self.assertIs(providers, syringe._PROVIDERS)
Esempio n. 3
0
    def test_empty(self):
        """
        Test that the providers dict is empty after clearing.

        """
        @syringe.provides('mock')
        class CLS(object):
            pass

        CLS()
        self.assertIn('mock', syringe._PROVIDERS)
        syringe.clear()
        self.assertDictEqual({}, syringe._PROVIDERS)
    def test_empty(self):
        """
        Test that the providers dict is empty after clearing.

        """
        @syringe.provides('mock')
        class CLS(object):
            pass

        CLS()
        self.assertIn('mock', syringe._PROVIDERS)
        syringe.clear()
        self.assertDictEqual({}, syringe._PROVIDERS)