From 43fce6a4ed1bb08cdf860a21e20be6848c7d76b7 Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Mon, 9 Feb 2026 16:45:36 -0500 Subject: [PATCH] Fix line length issues in IF session tests --- src/mudlib/if_session.py | 2 +- tests/test_if_session.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mudlib/if_session.py b/src/mudlib/if_session.py index 6804875..1a9d57f 100644 --- a/src/mudlib/if_session.py +++ b/src/mudlib/if_session.py @@ -36,7 +36,7 @@ class IFSession: """Return path to save file for this player/game combo.""" # Sanitize player name to prevent path traversal attacks # Account creation doesn't validate names, so defensive check here - safe_name = re.sub(r'[^a-zA-Z0-9_-]', '_', self.player.name) + safe_name = re.sub(r"[^a-zA-Z0-9_-]", "_", self.player.name) return self._data_dir / "if_saves" / safe_name / f"{self.game_name}.qzl" def _ensure_save_dir(self) -> None: diff --git a/tests/test_if_session.py b/tests/test_if_session.py index 994ffc7..887ca22 100644 --- a/tests/test_if_session.py +++ b/tests/test_if_session.py @@ -617,7 +617,9 @@ async def test_quit_then_stop_does_not_double_save(tmp_path): # Verify save was called once save_calls = [ - call for call in mock_process.stdin.write.call_args_list if call[0][0] == b"save\n" + call + for call in mock_process.stdin.write.call_args_list + if call[0][0] == b"save\n" ] assert len(save_calls) == 1 @@ -626,7 +628,9 @@ async def test_quit_then_stop_does_not_double_save(tmp_path): # Verify save was still only called once save_calls = [ - call for call in mock_process.stdin.write.call_args_list if call[0][0] == b"save\n" + call + for call in mock_process.stdin.write.call_args_list + if call[0][0] == b"save\n" ] assert len(save_calls) == 1, "stop() should not save again after ::quit" mock_process.terminate.assert_called_once() @@ -680,7 +684,9 @@ async def test_regular_input_resets_save_flag(tmp_path): # Verify save was called twice save_calls = [ - call for call in mock_process.stdin.write.call_args_list if call[0][0] == b"save\n" + call + for call in mock_process.stdin.write.call_args_list + if call[0][0] == b"save\n" ] assert len(save_calls) == 2, "should be able to save again after regular input"