From 8f010cfe4667d886622df2fad3c9c5c075563029 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 24 Aug 2026 15:07:58 +0200 Subject: [PATCH] Point the iptables tests at the module that now holds the code aecfd1a moved _block_store_iptables into _store_iptables but left its tests patching store_blocker.socket, which no longer exists there. My mistake: I read a --no-cov run as green when it was not, and committed 3 failures. 1347 tests, 100.00% coverage, verified with the coverage run this time. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016A1EYiv7e7HGhET84oa9M3 --- .../test_store_blocker_block_via_hosts_install.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/steam_backlog_enforcer/tests/test_store_blocker_block_via_hosts_install.py b/steam_backlog_enforcer/tests/test_store_blocker_block_via_hosts_install.py index 764c396..4cb4219 100644 --- a/steam_backlog_enforcer/tests/test_store_blocker_block_via_hosts_install.py +++ b/steam_backlog_enforcer/tests/test_store_blocker_block_via_hosts_install.py @@ -171,11 +171,11 @@ class TestBlockStoreIptables: mock_result = MagicMock(returncode=0) with ( patch( - "steam_backlog_enforcer.store_blocker.subprocess.run", + "steam_backlog_enforcer._store_iptables.subprocess.run", return_value=mock_result, ), patch( - "steam_backlog_enforcer.store_blocker.socket.getaddrinfo", + "steam_backlog_enforcer._store_iptables.socket.getaddrinfo", return_value=[ (None, None, None, None, ("1.2.3.4", 443)), ], @@ -186,7 +186,7 @@ class TestBlockStoreIptables: def test_os_error(self) -> None: """Test os error.""" with patch( - "steam_backlog_enforcer.store_blocker.subprocess.run", + "steam_backlog_enforcer._store_iptables.subprocess.run", side_effect=OSError, ): assert _block_store_iptables() is False @@ -198,11 +198,11 @@ class TestBlockStoreIptables: mock_result = MagicMock(returncode=0) with ( patch( - "steam_backlog_enforcer.store_blocker.subprocess.run", + "steam_backlog_enforcer._store_iptables.subprocess.run", return_value=mock_result, ), patch( - "steam_backlog_enforcer.store_blocker.socket.getaddrinfo", + "steam_backlog_enforcer._store_iptables.socket.getaddrinfo", side_effect=socket.gaierror, ), ): @@ -228,11 +228,11 @@ class TestBlockStoreIptables: with ( patch( - "steam_backlog_enforcer.store_blocker.subprocess.run", + "steam_backlog_enforcer._store_iptables.subprocess.run", side_effect=side_effect, ), patch( - "steam_backlog_enforcer.store_blocker.socket.getaddrinfo", + "steam_backlog_enforcer._store_iptables.socket.getaddrinfo", side_effect=__import__("socket").gaierror, ), ):