Exemplo 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)
Exemplo n.º 2
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)
Exemplo 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)
Exemplo n.º 4
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)