File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from pathlib import Path
22from typing import Optional
3- from unittest .mock import Mock , patch
3+ from unittest .mock import ANY , Mock , patch
44from urllib .parse import urlparse
55
66from pytest import mark
@@ -54,9 +54,9 @@ def test_upload_gain_reference(
5454 mock_subprocess .run .return_value = Mock (
5555 returncode = 0 , stderr = "An error has occurred."
5656 )
57- mock_tokens = {
58- session_id : "hello" ,
59- }
57+ # mock_tokens = {
58+ # session_id: "hello",
59+ # }
6060 # Construct payload and pass request to function
6161 gain_ref_file = f"{ gain_ref_dir } /gain.mrc"
6262 visit_path = "2025/aa00000-0"
@@ -78,7 +78,7 @@ def test_upload_gain_reference(
7878 machine_config_url = f"{ server_url } /instruments/{ instrument_name } /machine"
7979 mock_request .get .assert_called_once_with (
8080 machine_config_url ,
81- headers = {"Authorization" : f"Bearer { mock_tokens [ session_id ] } " },
81+ headers = {"Authorization" : ANY },
8282 )
8383
8484 # Check that the subprocess was run with the expected arguments
You can’t perform that action at this time.
0 commit comments