From 5d93d6c90e2d242fae8c325072d711aa36bfdd61 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Thu, 14 Sep 2023 14:41:46 +1000 Subject: [PATCH] Fix test --- koordinates/api/utils.py | 8 +++++++- koordinates/test/test_dataset.py | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/koordinates/api/utils.py b/koordinates/api/utils.py index 3864970..f8b62d1 100644 --- a/koordinates/api/utils.py +++ b/koordinates/api/utils.py @@ -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: diff --git a/koordinates/test/test_dataset.py b/koordinates/test/test_dataset.py index 90e3abf..b2bcd66 100644 --- a/koordinates/test/test_dataset.py +++ b/koordinates/test/test_dataset.py @@ -59,6 +59,10 @@ def test_point_cloud(self): "download", "write" ], + "user_capabilities": [ + "can-star", + "can-clone" + ], "name": "some repo name", "description": "" }