From e1b52739cbca67fd8e3fbdf83f7d2eb32b3ebf25 Mon Sep 17 00:00:00 2001 From: Michal-Babins Date: Thu, 15 Feb 2024 11:51:25 -0700 Subject: [PATCH] updated /v1/workflows/activities to /workflows/activities --- nmdc_automation/api/nmdcapi.py | 7 ++----- tests/test_nmdcapi.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/nmdc_automation/api/nmdcapi.py b/nmdc_automation/api/nmdcapi.py index 15948b93..7b67c036 100755 --- a/nmdc_automation/api/nmdcapi.py +++ b/nmdc_automation/api/nmdcapi.py @@ -180,11 +180,8 @@ def create_object(self, fn, description, dataurl): return resp.json() @refresh_token - def post_objects(self, obj_data, json_obj=None): - url = self._base_url + "v1/workflows/activities" - - # objects_file = open(json_obj) - # obj_data = json.load(objects_file) + def post_objects(self, obj_data): + url = self._base_url + "workflows/activities" resp = requests.post(url, headers=self.header, data=json.dumps(obj_data)) return resp.json() diff --git a/tests/test_nmdcapi.py b/tests/test_nmdcapi.py index 2d93ceeb..5546862d 100644 --- a/tests/test_nmdcapi.py +++ b/tests/test_nmdcapi.py @@ -39,7 +39,7 @@ def test_objects(mock_api, requests_mock): resp = n.create_object("./test_data/afile", "desc", "http://localhost/") # assert "checksums" in resp - url = "http://localhost/v1/workflows/activities" + url = "http://localhost/workflows/activities" requests_mock.post(url, json={"a": "b"}) resp = n.post_objects({"a": "b"}) assert "a" in resp