Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 24, 2023
1 parent ead93c0 commit 5d93d6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion koordinates/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ def capabilities_from_dataset_response(dataset: dict) -> Set[Capability]:
if not dataset.get("repository"):
capabilities.remove(Capability.Clone)
else:
repo_user_capabilities = dataset["repository"].get(
repo = dataset["repository"]
if repo and not isinstance(repo, dict):
from .client import KoordinatesClient
repo = KoordinatesClient.instance().get_json(
repo
)
repo_user_capabilities = repo.get(
"user_capabilities", []
)
if 'can-clone' not in repo_user_capabilities:
Expand Down
4 changes: 4 additions & 0 deletions koordinates/test/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def test_point_cloud(self):
"download",
"write"
],
"user_capabilities": [
"can-star",
"can-clone"
],
"name": "some repo name",
"description": ""
}
Expand Down

0 comments on commit 5d93d6c

Please sign in to comment.