From b3e706bf9664b25bf58fd3971b9c144efda2d59f Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Wed, 16 Oct 2024 21:24:50 +0200 Subject: [PATCH] fix live tests: update rsd api endpoint and repository url filtering --- livetests/test_howfairis_on_rsd_urls.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/livetests/test_howfairis_on_rsd_urls.py b/livetests/test_howfairis_on_rsd_urls.py index b4dc928f..d859233f 100644 --- a/livetests/test_howfairis_on_rsd_urls.py +++ b/livetests/test_howfairis_on_rsd_urls.py @@ -11,7 +11,7 @@ def get_urls(n=None): - software_api_url = "https://www.research-software.nl/api/software?isPublished=true" + software_api_url = "https://research-software-directory.org/api/v1/repository_url" try: response = requests.get(software_api_url) # If the response was successful, no Exception will be raised @@ -21,9 +21,9 @@ def get_urls(n=None): return False urls = [] - for d in response.json(): - for key, values in d["repositoryURLs"].items(): - urls.extend(values) + for _repo in response.json(): + if _repo["url"].startswith(("https://github.com", "https://gitlab.com")): + urls.append(_repo["url"]) if n is None: return random.shuffle(urls) else: