adjust test for new return type of visitor, add download strategy parameter to config

This commit is contained in:
Julius Unverfehrt 2022-06-14 12:33:41 +02:00
parent bb7e631f91
commit c033d98acd
3 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@ service:
logging_level: $LOGGING_LEVEL_ROOT|DEBUG # Logging level for service logger
response_file_extension: $RESPONSE_FILE_EXTENSION|"json.gz" # Extension for files uploaded to storage
response_folder: $RESPONSE_FOLDER|null
download_strategy: single
probing_webserver:
host: $PROBING_WEBSERVER_HOST|"0.0.0.0" # Probe webserver address

View File

@ -300,7 +300,7 @@ def get_download_strategy(download_strategy_type=None):
"single": SingleDownloadStrategy(),
"multi": MultiDownloadStrategy(),
}
return download_strategies.get(download_strategy_type or CONFIG.download_strategy, SingleDownloadStrategy())
return download_strategies.get(download_strategy_type or CONFIG.service.download_strategy, SingleDownloadStrategy())
class DownloadStrategy(abc.ABC):

View File

@ -20,8 +20,8 @@ class TestVisitor:
):
storage.clear_bucket(bucket_name)
storage.put_object(**get_object_descriptor(body), data=pack_for_upload(b"content"))
data_received = visitor.load_data(body)
assert {"data": b"content", "metadata": {}} == data_received
data_received = list(visitor.load_data(body))
assert [{"data": b"content", "metadata": {}}] == data_received
@pytest.mark.parametrize("response_strategy_name", ["forwarding", "storage"], scope="session")
def test_visitor_pulls_and_processes_data(self, visitor, body, storage, bucket_name):