diff --git a/tests/backend/test_auto_propagation.py b/tests/backend/test_auto_propagation.py index bc1dcc9..035c254 100644 --- a/tests/backend/test_auto_propagation.py +++ b/tests/backend/test_auto_propagation.py @@ -93,8 +93,8 @@ async def test_auto_propagation_logic(): # announce1 is 1 hop, but probe fails # announce3 is 2 hops, probe succeeds mock_hops.side_effect = lambda dh: 1 if dh == bytes.fromhex("aaaa1111") else 2 - mock_probe.side_effect = ( - lambda dh: False if dh == bytes.fromhex("aaaa1111") else True + mock_probe.side_effect = lambda dh: ( + False if dh == bytes.fromhex("aaaa1111") else True ) await manager.check_and_update_propagation_node() diff --git a/tests/backend/test_fuzzing_extended.py b/tests/backend/test_fuzzing_extended.py index b5b58b9..27c38b7 100644 --- a/tests/backend/test_fuzzing_extended.py +++ b/tests/backend/test_fuzzing_extended.py @@ -353,17 +353,19 @@ def test_markdown_renderer_fuzzing(text): @given( text=st.one_of( st.text(min_size=0, max_size=5000), - st.sampled_from([ - "", - "[x](javascript:alert(1))", - "[x](data:text/html,)", - "**" * 2000, - "#" * 2000, - "`" * 2000, - "[](" * 500 + ")" * 500, - "\x00\x01\x02\n\t", - "\ufffd" * 100, - ]), + st.sampled_from( + [ + "", + "[x](javascript:alert(1))", + "[x](data:text/html,)", + "**" * 2000, + "#" * 2000, + "`" * 2000, + "[](" * 500 + ")" * 500, + "\x00\x01\x02\n\t", + "\ufffd" * 100, + ] + ), ), ) def test_markdown_renderer_dangerous_patterns(text): diff --git a/tests/backend/test_lxmf_sync.py b/tests/backend/test_lxmf_sync.py index bccb4fa..f9a5010 100644 --- a/tests/backend/test_lxmf_sync.py +++ b/tests/backend/test_lxmf_sync.py @@ -157,9 +157,7 @@ async def test_status_includes_sync_storage_and_confirmation_metrics(mock_app): if r.path == "/api/v1/lxmf/propagation-node/sync" ) - mock_app.current_context.message_router.get_outbound_propagation_node.return_value = ( - b"somehash" - ) + mock_app.current_context.message_router.get_outbound_propagation_node.return_value = b"somehash" mock_app.current_context.message_router.propagation_transfer_last_result = 8 with ( @@ -213,9 +211,7 @@ async def test_status_hidden_metric_is_clamped_to_zero(mock_app): if r.path == "/api/v1/lxmf/propagation-node/sync" ) - mock_app.current_context.message_router.get_outbound_propagation_node.return_value = ( - b"somehash" - ) + mock_app.current_context.message_router.get_outbound_propagation_node.return_value = b"somehash" mock_app.current_context.message_router.propagation_transfer_last_result = 1 with ( diff --git a/tests/backend/test_markdown_renderer.py b/tests/backend/test_markdown_renderer.py index ddacae0..f62987d 100644 --- a/tests/backend/test_markdown_renderer.py +++ b/tests/backend/test_markdown_renderer.py @@ -77,7 +77,7 @@ class TestMarkdownRenderer(unittest.TestCase): cases = [ "", "", - "", + '', "", ] for s in cases: diff --git a/tests/backend/test_meshchat_coverage.py b/tests/backend/test_meshchat_coverage.py index fcb5c12..4753be4 100644 --- a/tests/backend/test_meshchat_coverage.py +++ b/tests/backend/test_meshchat_coverage.py @@ -290,4 +290,6 @@ def test_on_lxmf_sending_failed_no_propagation(mock_app): mock_app.on_lxmf_sending_state_updated = MagicMock() mock_app.on_lxmf_sending_failed(mock_msg) - mock_app.on_lxmf_sending_state_updated.assert_called_once_with(mock_msg, context=None) + mock_app.on_lxmf_sending_state_updated.assert_called_once_with( + mock_msg, context=None + ) diff --git a/tests/backend/test_risky_inputs.py b/tests/backend/test_risky_inputs.py index bbff2a4..5cc090b 100644 --- a/tests/backend/test_risky_inputs.py +++ b/tests/backend/test_risky_inputs.py @@ -9,7 +9,16 @@ class TestBase64DecodeRisky(unittest.TestCase): from meshchatx.src.backend.meshchat_utils import parse_lxmf_display_name except ImportError: self.skipTest("meshchat_utils not importable") - for bad in ["!!!", "\x00\x01", "a" * 10000, " ", "=", "===", "a\nb\tc", "\xff\xfe"]: + for bad in [ + "!!!", + "\x00\x01", + "a" * 10000, + " ", + "=", + "===", + "a\nb\tc", + "\xff\xfe", + ]: result = parse_lxmf_display_name(bad, default_value="Fallback") self.assertIsInstance(result, str)