File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -93,18 +93,19 @@ def test_update_s3(tmp_path, monkeypatch):
9393 assert tfc ._s3 .update (newhome , local = False , overwrite = False )
9494
9595
96+ def mock_get (* args , ** kwargs ):
97+ class MockResponse :
98+ status_code = 400
99+
100+ return MockResponse ()
101+
102+
96103def test_s3_400_error (monkeypatch ):
97104 """Simulate a 400 error when fetching the skeleton file."""
98105
99106 reload (tfc )
100107 reload (tf )
101108
102- def mock_get (* args , ** kwargs ):
103- class MockResponse :
104- status_code = 400
105-
106- return MockResponse ()
107-
108109 monkeypatch .setattr (requests , 'get' , mock_get )
109110 with pytest .raises (RuntimeError ):
110111 tf ._s3_get (
@@ -142,13 +143,6 @@ def test_bad_skeleton(tmp_path, monkeypatch):
142143
143144 path .write_bytes (error_file .read_bytes ())
144145
145- # Run full get but mock 400 to avoid actual network call
146- def mock_get (* args , ** kwargs ):
147- class MockResponse :
148- status_code = 400
149-
150- return MockResponse ()
151-
152146 monkeypatch .setattr (requests , 'get' , mock_get )
153147 with pytest .raises (RuntimeError ):
154148 tf .get ('MNI152NLin2009cAsym' , resolution = '02' , suffix = 'T1w' , desc = None )
You can’t perform that action at this time.
0 commit comments