mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-22 03:02:19 +01:00
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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016A1EYiv7e7HGhET84oa9M3
This commit is contained in:
parent
aecfd1a3a0
commit
8f010cfe46
@ -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,
|
||||
),
|
||||
):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user