Esempio n. 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')
Esempio n. 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')
Esempio n. 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)
Esempio n. 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)
Esempio n. 5
0
 def setUp(self):
     self.backend = EnvBackend()
Esempio n. 6
0
 def setUp(self):
     self.backend = EnvBackend()
     self.patch = mock.patch('os.getenv', auto_spec=True)
     super(TestPatchedEnvBackend, self).setUp()
Esempio n. 7
0
 def setUp(self):
     self.backend = EnvBackend()
     self.patch = mock.patch('os.getenv', auto_spec=True)
     super(TestPatchedEnvBackend, self).setUp()
Esempio n. 8
0
 def setUp(self):
     self.backend = EnvBackend()