Пример #1
0
class TestPatchedEnvBackend(BasePatchTest, unittest.TestCase):
    def setUp(self):
        self.backend = EnvBackend()
        self.patch = mock.patch('os.getenv', auto_spec=True)
        super(TestPatchedEnvBackend, self).setUp()

    def test_simple(self):
        self.backend.load('key')
        self.mock.assert_called_with('key')

    def test_e2e(self):
        self.loader.load('key')
        self.mock.assert_called_with('key')
Пример #2
0
class TestPatchedEnvBackend(BasePatchTest, unittest.TestCase):

    def setUp(self):
        self.backend = EnvBackend()
        self.patch = mock.patch('os.getenv', auto_spec=True)
        super(TestPatchedEnvBackend, self).setUp()

    def test_simple(self):
        self.backend.load('key')
        self.mock.assert_called_with('key')

    def test_e2e(self):
        self.loader.load('key')
        self.mock.assert_called_with('key')
Пример #3
0
class TestEnvBackend(unittest.TestCase):
    def setUp(self):
        self.backend = EnvBackend()

    def test_missing_key_returns_none(self):
        cred = self.backend.load('this_key_should_not_be_in_any_env_42')
        self.assertEqual(cred, None)
Пример #4
0
class TestEnvBackend(unittest.TestCase):

    def setUp(self):
        self.backend = EnvBackend()

    def test_missing_key_returns_none(self):
        cred = self.backend.load('this_key_should_not_be_in_any_env_42')
        self.assertEqual(cred, None)
Пример #5
0
 def setUp(self):
     self.backend = EnvBackend()
Пример #6
0
 def setUp(self):
     self.backend = EnvBackend()
     self.patch = mock.patch('os.getenv', auto_spec=True)
     super(TestPatchedEnvBackend, self).setUp()
Пример #7
0
 def setUp(self):
     self.backend = EnvBackend()
     self.patch = mock.patch('os.getenv', auto_spec=True)
     super(TestPatchedEnvBackend, self).setUp()
Пример #8
0
 def setUp(self):
     self.backend = EnvBackend()