diff --git a/pyvo/dal/tests/test_tap.py b/pyvo/dal/tests/test_tap.py index 0c22dc84..3e075974 100644 --- a/pyvo/dal/tests/test_tap.py +++ b/pyvo/dal/tests/test_tap.py @@ -6,7 +6,7 @@ from contextlib import ExitStack import datetime import re -from io import BytesIO +from io import BytesIO, StringIO from urllib.parse import parse_qsl import tempfile @@ -802,3 +802,37 @@ def test_get_endpoint_candidates(): "http://astroweb.projects.phys.ucl.ac.uk:8000/capabilities" ] assert svc._get_endpoint_candidates("capabilities") == expected_urls + + +@pytest.mark.remote_data +@pytest.mark.parametrize('stream_type', [BytesIO, StringIO]) +def test_tap_upload_remote(stream_type): + tmp_table = (''' + + + + + external URI for the physical artifact + + + + + + + + +
2013.1.01365.S
+
+
''') + + if stream_type == BytesIO: + tmp_table = tmp_table.encode() + query = ('select top 3 proposal_id from ivoa.ObsCore oc join ' + 'TAP_UPLOAD.proj_codes pc on oc.proposal_id=pc.prop_id') + service = TAPService('https://almascience.nrao.edu/tap') + + res = service.search(query, uploads={'proj_codes': stream_type(tmp_table)}) + assert len(res) == 3 + for row in res: + assert row['proposal_id'] == '2013.1.01365.S'