Fetch prefect host and test

This commit is contained in:
Pablo Martin 2023-01-16 14:03:12 +01:00
parent 2d9300c18e
commit 9606e3e269
2 changed files with 28 additions and 0 deletions

View file

@ -91,3 +91,20 @@ def test_lolaconfig_fetches_dw_creds_properly():
lolaconfig.fetch_dw_credentials(s3_reader=fake_s3_reader)
assert type(lolaconfig.DW_CREDENTIALS) is dict
def test_lolaconfig_fetches_prefect_host_properly():
lolaconfig = LolaConfig(flow_name="some-flow")
fake_s3_reader = SimpleNamespace()
def mock_read_json_from_s3_file(bucket, key):
return {
"prefect_host": "some_host",
}
fake_s3_reader.read_json_from_s3_file = mock_read_json_from_s3_file
lolaconfig.fetch_prefect_host(s3_reader=fake_s3_reader)
assert type(lolaconfig.PREFECT_HOST) is str