Skip to content

Commit

Permalink
Merge pull request #1527 from lincbrain/ak-linc
Browse files Browse the repository at this point in the history
Include LINC API as a supported instance type for DANDI CLI
  • Loading branch information
yarikoptic authored Nov 15, 2024
2 parents 5066cca + 284ead1 commit 06c10cc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
6 changes: 6 additions & 0 deletions dandi/cli/tests/test_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ def test_cmd_instances(monkeypatch):
"dandi-staging:\n"
" api: https://api-staging.dandiarchive.org/api\n"
" gui: https://gui-staging.dandiarchive.org\n"
"linc:\n"
" api: https://api.lincbrain.org/api\n"
" gui: https://lincbrain.org\n"
"linc-staging:\n"
" api: https://staging-api.lincbrain.org/api\n"
" gui: https://staging.lincbrain.org\n"
)
10 changes: 10 additions & 0 deletions dandi/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ def urls(self) -> Iterator[str]:
f"http://{instancehost}:8085",
f"http://{instancehost}:8000/api",
),
"linc": DandiInstance(
"linc",
"https://lincbrain.org",
"https://api.lincbrain.org/api",
),
"linc-staging": DandiInstance(
"linc-staging",
"https://staging.lincbrain.org",
"https://staging-api.lincbrain.org/api",
)
}
# to map back url: name
known_instances_rev = {
Expand Down
9 changes: 5 additions & 4 deletions dandi/tests/test_dandiarchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,11 @@ def test_known_instances() -> None:
def test_parse_dandi_url_unknown_instance() -> None:
with pytest.raises(UnknownURLError) as excinfo:
parse_dandi_url("dandi://not-an-instance/000001")
assert str(excinfo.value) == (
"Unknown instance 'not-an-instance'. Valid instances: dandi,"
" dandi-api-local-docker-tests, dandi-staging"
)

valid_instances = ", ".join(sorted(known_instances.keys()))
expected_message = f"Unknown instance 'not-an-instance'. Valid instances: {valid_instances}"

assert str(excinfo.value) == expected_message


@mark.skipif_no_network
Expand Down
6 changes: 6 additions & 0 deletions docs/source/cmdline/instances.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ Example output:
dandi-staging:
api: https://api-staging.dandiarchive.org/api
gui: https://gui-staging.dandiarchive.org
linc-staging:
api: https://staging-api.lincbrain.org/api
gui: https://staging.lincbrain.org
linc:
api: https://api.lincbrain.org/api
gui: https://lincbrain.org

0 comments on commit 06c10cc

Please sign in to comment.