Skip to content

Commit a4a274b

Browse files
committed
Added test for '_get_murfey_url' function
1 parent 26b0b17 commit a4a274b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/instrument_server/test_api.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,25 @@
55

66
from pytest import mark
77

8-
from murfey.instrument_server.api import GainReference, upload_gain_reference
8+
from murfey.instrument_server.api import (
9+
GainReference,
10+
_get_murfey_url,
11+
upload_gain_reference,
12+
)
913
from murfey.util import posix_path
1014

15+
16+
def test_get_murfey_url(
17+
mock_client_configuration, # From conftest.py
18+
):
19+
# Mock the module-wide config variable with the fixture value
20+
# The fixture is only loaded within the test function, so this patch
21+
# has to happen inside the function instead of as a decorator
22+
with patch("murfey.instrument_server.api.config", mock_client_configuration):
23+
known_server = _get_murfey_url()
24+
assert known_server == mock_client_configuration["Murfey"].get("server")
25+
26+
1127
test_upload_gain_reference_params_matrix = (
1228
# Rsync URL settings
1329
("http://1.1.1.1",), # When rsync_url is provided

0 commit comments

Comments
 (0)