Skip to content

Commit

Permalink
Move config.json to datagateway_api directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkyffin committed Feb 16, 2021
1 parent 339174f commit 6b8e1e9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion datagateway_api/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6b8e1e9

Please sign in to comment.