diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index de7cfeab..b90d9cce 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -63,9 +63,9 @@ jobs: run: touch logs.log - name: Configure log file location run: echo "`jq -r --arg REPO_DIR "$GITHUB_WORKSPACE/logs.log" \ - '.log_location=$REPO_DIR' config.json.example`" > config.json.example + '.log_location=$REPO_DIR' datagateway_api/config.json.example`" > datagateway_api/config.json.example - name: Create config.json - run: cp config.json.example config.json + run: cp datagateway_api/config.json.example datagateway_api/config.json # Install Nox, Poetry and API's dependencies - name: Install Nox diff --git a/README.md b/README.md index 2fc4f4a8..2eb0e403 100644 --- a/README.md +++ b/README.md @@ -427,8 +427,8 @@ illustrated below: ├── .pre-commit-config.yaml ├── LICENSE ├── README.md -├── config.json.example ├── datagateway_api +│ ├── config.json.example │ ├── common │ │ ├── backend.py │ │ ├── backends.py diff --git a/datagateway_api/common/config.py b/datagateway_api/common/config.py index 9b5090a4..28e4d8d1 100644 --- a/datagateway_api/common/config.py +++ b/datagateway_api/common/config.py @@ -10,7 +10,7 @@ class Config(object): - def __init__(self, path=Path(__file__).parent.parent.parent / "config.json"): + def __init__(self, path=Path(__file__).parent.parent / "config.json"): self.path = path with open(self.path) as target: self.config = json.load(target) diff --git a/config.json.example b/datagateway_api/config.json.example similarity index 100% rename from config.json.example rename to datagateway_api/config.json.example diff --git a/test/test_config.py b/test/test_config.py index 4d5da769..108f4cdc 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -8,7 +8,9 @@ @pytest.fixture() def valid_config(): - return Config(path=Path(__file__).parent.parent / "config.json.example") + return Config( + path=Path(__file__).parent.parent / "datagateway_api" / "config.json.example" + ) @pytest.fixture()