From 9a1476bff3cf77a90297e27bfff83e8e1d499e42 Mon Sep 17 00:00:00 2001 From: SharonGoliath Date: Tue, 7 Sep 2021 14:01:31 -0700 Subject: [PATCH] CADC-10021 - status method change. (#195) --- vos/setup.cfg | 2 +- vos/vos/tests/test_vos.py | 9 +++++++++ vos/vos/vos.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/vos/setup.cfg b/vos/setup.cfg index 02ec81e7..6f4e7d55 100644 --- a/vos/setup.cfg +++ b/vos/setup.cfg @@ -50,7 +50,7 @@ edit_on_github = False github_project = opencadc/vostools install_requires = html2text>=2016.5.29 cadcutils>=1.2.1 future aenum # version should be PEP440 compatible (http://www.python.org/dev/peps/pep-0440) -version = 3.3.2 +version = 3.3.3 [entry_points] diff --git a/vos/vos/tests/test_vos.py b/vos/vos/tests/test_vos.py index 4fcb233a..e3796bba 100644 --- a/vos/vos/tests/test_vos.py +++ b/vos/vos/tests/test_vos.py @@ -42,6 +42,8 @@ class Object(object): pass +@patch('vos.vos.net.ws.WsCapabilities.get_access_url', + Mock(return_value='http://foo.com/vospace')) def test_get_node_url(): client = Client() with pytest.raises(TypeError): @@ -783,6 +785,13 @@ def test_mkdir(self): 'http://www.canfar.phys.uvic.ca/vospace/nodes/bar', headers=headers, data=str(node)) + @patch('vos.vos.net.ws.WsCapabilities.get_access_url', + Mock(return_value='http://foo.com/vospace')) + def test_success_failure_case(self): + with pytest.raises(OSError): + client = Client() + ignore = client.status('vos:test/node.fits', code='abc') + class TestNode(unittest.TestCase): """Test the vos Node class. diff --git a/vos/vos/vos.py b/vos/vos/vos.py index 4782aa8d..1d4d4ba4 100644 --- a/vos/vos/vos.py +++ b/vos/vos/vos.py @@ -2826,7 +2826,7 @@ def status(self, uri, code=None): status on. :param code: NOT SUPPORTED. """ - if not code: + if code: raise OSError(errno.ENOSYS, "Use of 'code' option values no longer supported.") self.get_node(uri)