Skip to content

Commit f242cd1

Browse files
committed
Adjusted assertion logic for urlparse result
1 parent 914e997 commit f242cd1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/instrument_server/test_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
@mark.parametrize("test_params", test_upload_gain_reference_params_matrix)
3737
@patch("murfey.instrument_server.api.subprocess")
38-
@patch("murfey.instrument_server.api.urlparse", wraps=urlparse)
38+
@patch("murfey.instrument_server.api.urlparse", wrap=urlparse)
3939
@patch("murfey.instrument_server.api._get_murfey_url")
4040
@patch("murfey.instrument_server.api.requests")
4141
def test_upload_gain_reference(
@@ -79,10 +79,10 @@ def test_upload_gain_reference(
7979

8080
# If no rsync_url key is provided, or rsync_url key is empty,
8181
# This should default to the Murfey URL
82-
if not rsync_url:
83-
assert spy_parse.return_value == urlparse(server_url)
84-
else:
85-
assert spy_parse.return_value == urlparse(rsync_url)
82+
expected_urlparse = urlparse(server_url) if not rsync_url else urlparse(rsync_url)
83+
assert expected_urlparse.scheme == spy_parse.return_value.scheme
84+
assert expected_urlparse.netloc == spy_parse.return_value.netloc
85+
assert expected_urlparse.path == spy_parse.return_value.path
8686

8787
# Check that the subprocess was run
8888
mock_subprocess.run.assert_called_once()

0 commit comments

Comments
 (0)