Fetch DW credentials and test.

This commit is contained in:
Pablo Martin 2023-01-16 13:57:34 +01:00
parent 3590bedffd
commit 2d9300c18e
2 changed files with 37 additions and 0 deletions

View file

@ -71,3 +71,23 @@ def test_lolaconfig_fetches_ssh_tunnel_creds_properly():
lolaconfig.fetch_ssh_tunnel_credentials(s3_reader=fake_s3_reader)
assert type(lolaconfig.SSH_TUNNEL_CREDENTIALS) is dict
def test_lolaconfig_fetches_dw_creds_properly():
lolaconfig = LolaConfig(flow_name="some-flow")
fake_s3_reader = SimpleNamespace()
def mock_read_json_from_s3_file(bucket, key):
return {
"datadw_host": "some_host",
"datadw_user": "some_user",
"datadw_pass": "some_password",
"datadw_port": "some_port",
}
fake_s3_reader.read_json_from_s3_file = mock_read_json_from_s3_file
lolaconfig.fetch_dw_credentials(s3_reader=fake_s3_reader)
assert type(lolaconfig.DW_CREDENTIALS) is dict