Ejemplo n.º 1
0
def test_get_secret_file(tmpdir, database):
    with tmpdir.as_cwd():
        expected = 'password'
        with open(tmpdir.join('client_secrets.json').strpath, 'w') as secrets:
            secret = {'secret': expected}
            secrets.write(json.dumps(secret))
        actual = get_secret('secret')
        assert expected == actual
Ejemplo n.º 2
0
 def load_secrets(self):
     logging.info("Loading secrets: {}".format(self.secrets))
     return [get_secret(name) for name in self.secrets]
Ejemplo n.º 3
0
def test_get_secret_file_no_exist(tmpdir, database):
    with tmpdir.as_cwd():
        with pytest.raises(IOError):
            assert get_secret('secret')