Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • workers/base-worker
1 result
Show changes
Commits on Source (5)
......@@ -229,7 +229,7 @@ class BaseWorker(object):
)
# Retrieve initial configuration from API
self.config = worker_version["configuration"].get("configuration")
self.config = worker_version["configuration"].get("configuration", {})
if "user_configuration" in worker_version["configuration"]:
# Add default values (if set) to user_configuration
for key, value in worker_version["configuration"][
......
black==22.8.0
doc8==0.11.1
mkdocs==1.4.0
mkdocs-material==8.5.5
mkdocs-material==8.5.6
mkdocstrings==0.19.0
mkdocstrings-python==0.7.1
recommonmark==0.7.1
pytest==7.1.3
pytest-mock==3.9.0
pytest-responses==0.5.0
pytest-mock==3.10.0
pytest-responses==0.5.1
requests==2.28.1
......@@ -2,10 +2,13 @@
import os
import pytest
from arkindex_worker.worker.base import BaseWorker
from arkindex.mock import MockApiClient
@pytest.fixture(autouse=True)
def setup_environment(responses):
def setup_environment(responses, monkeypatch):
"""Setup needed environment variables"""
# Allow accessing remote API schemas
......@@ -20,3 +23,6 @@ def setup_environment(responses):
os.environ["ARKINDEX_API_SCHEMA_URL"] = schema_url
# Setup a fake worker run ID
os.environ["ARKINDEX_WORKER_RUN_ID"] = "1234-{{ cookiecutter.slug }}"
# Setup a mock api client instead of using a real one
monkeypatch.setattr(BaseWorker, "setup_api_client", lambda _: MockApiClient())