Skip to content

Commit fb62ccc

Browse files
committed
Adjusted assertion logic for urlparse return value
1 parent f242cd1 commit fb62ccc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/instrument_server/test_api.py

Lines changed: 5 additions & 4 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", wrap=urlparse)
38+
@patch("murfey.instrument_server.api.urlparse", wraps=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,11 @@ 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+
returned_urlparse = spy_parse.return_value
8283
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
84+
assert expected_urlparse.scheme == returned_urlparse.scheme
85+
assert expected_urlparse.netloc == returned_urlparse.netloc
86+
assert expected_urlparse.path == returned_urlparse.path
8687

8788
# Check that the subprocess was run
8889
mock_subprocess.run.assert_called_once()

0 commit comments

Comments
 (0)