Skip to content
Snippets Groups Projects
Commit 3eae9f78 authored by Andrew Kapuscinski's avatar Andrew Kapuscinski
Browse files

modified datafetcher tests to run inside docker container

parent e9788ea7
No related branches found
No related tags found
1 merge request!116WS 78 fix datafetcher tests
......@@ -24,7 +24,7 @@ def get_project_root() -> Path:
"""
my_path = Path(__file__)
path = my_path
while not path.name.endswith("workspaces") and not path.name.endswith("code"):
while not path.name.endswith("workspaces") and not path.name.endswith("packages"):
path = path.parent
return path
......@@ -53,7 +53,7 @@ from datafetcher.utilities import (
RetrievalMode,
)
TEST_PROFILE = "local"
TEST_PROFILE = "docker"
MISSING_SETTING = ReturnCode.MISSING_SETTING.value["code"]
MISSING_PROFILE = ReturnCode.MISSING_PROFILE.value["code"]
RUN_ALL = True
......
......@@ -66,12 +66,22 @@ def test_omitted_profile_returns_expected_code(make_tempdir, settings):
:return:
"""
# store existing CAPO_PROFILE
existing_capo_profile = os.environ["CAPO_PROFILE"]
# remove existing CAPO_PROFILE
os.environ["CAPO_PROFILE"] = ""
# omit --profile arg
args = ['--product-locator', settings.test_data['product_locator'],
'--output-dir', str(make_tempdir)]
return_code = launch_datafetcher(args, settings.capo_settings)
assert return_code == MISSING_PROFILE
# restore the existing CAPO_PROFILE
os.environ["CAPO_PROFILE"] = existing_capo_profile
@pytest.mark.skipif(not RUN_ALL, reason='debug')
def test_omitted_capo_value_returns_expected_code(make_tempdir, settings):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment