@@ -209,8 +209,9 @@ def test_prompt_overwrite_yes(self, validator, tmp_path):
209209 target = tmp_path / "file.txt"
210210 target .write_text ("data" )
211211
212- with patch ("gaia.security._is_interactive" , return_value = True ), patch (
213- "builtins.input" , return_value = "y"
212+ with (
213+ patch ("gaia.security._is_interactive" , return_value = True ),
214+ patch ("builtins.input" , return_value = "y" ),
214215 ):
215216 result = validator ._prompt_overwrite (target , 100 )
216217
@@ -221,8 +222,9 @@ def test_prompt_overwrite_no(self, validator, tmp_path):
221222 target = tmp_path / "file.txt"
222223 target .write_text ("data" )
223224
224- with patch ("gaia.security._is_interactive" , return_value = True ), patch (
225- "builtins.input" , return_value = "n"
225+ with (
226+ patch ("gaia.security._is_interactive" , return_value = True ),
227+ patch ("builtins.input" , return_value = "n" ),
226228 ):
227229 result = validator ._prompt_overwrite (target , 100 )
228230
@@ -233,8 +235,9 @@ def test_prompt_overwrite_yes_full_word(self, validator, tmp_path):
233235 target = tmp_path / "file.txt"
234236 target .write_text ("data" )
235237
236- with patch ("gaia.security._is_interactive" , return_value = True ), patch (
237- "builtins.input" , return_value = "yes"
238+ with (
239+ patch ("gaia.security._is_interactive" , return_value = True ),
240+ patch ("builtins.input" , return_value = "yes" ),
238241 ):
239242 result = validator ._prompt_overwrite (target , 100 )
240243
@@ -245,8 +248,9 @@ def test_prompt_overwrite_no_full_word(self, validator, tmp_path):
245248 target = tmp_path / "file.txt"
246249 target .write_text ("data" )
247250
248- with patch ("gaia.security._is_interactive" , return_value = True ), patch (
249- "builtins.input" , return_value = "no"
251+ with (
252+ patch ("gaia.security._is_interactive" , return_value = True ),
253+ patch ("builtins.input" , return_value = "no" ),
250254 ):
251255 result = validator ._prompt_overwrite (target , 100 )
252256
@@ -258,8 +262,9 @@ def test_prompt_overwrite_invalid_then_yes(self, validator, tmp_path):
258262 target .write_text ("data" )
259263
260264 # Simulate: "maybe" -> "xxx" -> "y"
261- with patch ("gaia.security._is_interactive" , return_value = True ), patch (
262- "builtins.input" , side_effect = ["maybe" , "xxx" , "y" ]
265+ with (
266+ patch ("gaia.security._is_interactive" , return_value = True ),
267+ patch ("builtins.input" , side_effect = ["maybe" , "xxx" , "y" ]),
263268 ):
264269 result = validator ._prompt_overwrite (target , 200 )
265270
@@ -271,8 +276,9 @@ def test_prompt_overwrite_invalid_then_no(self, validator, tmp_path):
271276 target .write_text ("data" )
272277
273278 # Simulate: "" -> "asdf" -> "n"
274- with patch ("gaia.security._is_interactive" , return_value = True ), patch (
275- "builtins.input" , side_effect = ["" , "asdf" , "n" ]
279+ with (
280+ patch ("gaia.security._is_interactive" , return_value = True ),
281+ patch ("builtins.input" , side_effect = ["" , "asdf" , "n" ]),
276282 ):
277283 result = validator ._prompt_overwrite (target , 50 )
278284
@@ -291,8 +297,9 @@ def test_prompt_overwrite_prints_file_info(self, validator, tmp_path):
291297 " " .join (str (x ) for x in a )
292298 ),
293299 ):
294- with patch ("gaia.security._is_interactive" , return_value = True ), patch (
295- "builtins.input" , return_value = "y"
300+ with (
301+ patch ("gaia.security._is_interactive" , return_value = True ),
302+ patch ("builtins.input" , return_value = "y" ),
296303 ):
297304 validator ._prompt_overwrite (target , 2048 )
298305
@@ -307,9 +314,10 @@ def test_prompt_overwrite_non_interactive_approves_with_backup(
307314 target = tmp_path / "file.txt"
308315 target .write_text ("data" )
309316
310- with patch ("gaia.security._is_interactive" , return_value = False ), patch (
311- "builtins.input"
312- ) as mock_input :
317+ with (
318+ patch ("gaia.security._is_interactive" , return_value = False ),
319+ patch ("builtins.input" ) as mock_input ,
320+ ):
313321 result = validator ._prompt_overwrite (target , 100 )
314322
315323 assert result is True
0 commit comments