Skip to content

Commit

Permalink
added sia and register_mocks fixtures to test
Browse files Browse the repository at this point in the history
  • Loading branch information
d-giles committed Oct 4, 2024
1 parent 1c2019b commit ff01bba
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pyvo/dal/tests/test_datalink.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Tests for pyvo.dal.datalink
"""
from functools import partial
import re

import pytest

Expand All @@ -30,6 +31,24 @@ def callback(request, context):
) as matcher:
yield matcher

sia_re = re.compile('http://example.com/sia.*')


@pytest.fixture()
def register_mocks(mocker):
with mocker.register_uri(
'GET', 'http://example.com/querydata/image.fits',
content=get_pkg_data_contents('data/querydata/image.fits')
) as matcher:
yield matcher


@pytest.fixture()
def sia(mocker):
with mocker.register_uri(
'GET', sia_re, content=get_pkg_data_contents('data/sia/dataset.xml')
) as matcher:
yield matcher

@pytest.fixture()
def datalink(mocker):
Expand Down

0 comments on commit ff01bba

Please sign in to comment.