mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-28 12:09:18 +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)
|
mock_result = MagicMock(returncode=0)
|
||||||
with (
|
with (
|
||||||
patch(
|
patch(
|
||||||
"steam_backlog_enforcer.store_blocker.subprocess.run",
|
"steam_backlog_enforcer._store_iptables.subprocess.run",
|
||||||
return_value=mock_result,
|
return_value=mock_result,
|
||||||
),
|
),
|
||||||
patch(
|
patch(
|
||||||
"steam_backlog_enforcer.store_blocker.socket.getaddrinfo",
|
"steam_backlog_enforcer._store_iptables.socket.getaddrinfo",
|
||||||
return_value=[
|
return_value=[
|
||||||
(None, None, None, None, ("1.2.3.4", 443)),
|
(None, None, None, None, ("1.2.3.4", 443)),
|
||||||
],
|
],
|
||||||
@ -186,7 +186,7 @@ class TestBlockStoreIptables:
|
|||||||
def test_os_error(self) -> None:
|
def test_os_error(self) -> None:
|
||||||
"""Test os error."""
|
"""Test os error."""
|
||||||
with patch(
|
with patch(
|
||||||
"steam_backlog_enforcer.store_blocker.subprocess.run",
|
"steam_backlog_enforcer._store_iptables.subprocess.run",
|
||||||
side_effect=OSError,
|
side_effect=OSError,
|
||||||
):
|
):
|
||||||
assert _block_store_iptables() is False
|
assert _block_store_iptables() is False
|
||||||
@ -198,11 +198,11 @@ class TestBlockStoreIptables:
|
|||||||
mock_result = MagicMock(returncode=0)
|
mock_result = MagicMock(returncode=0)
|
||||||
with (
|
with (
|
||||||
patch(
|
patch(
|
||||||
"steam_backlog_enforcer.store_blocker.subprocess.run",
|
"steam_backlog_enforcer._store_iptables.subprocess.run",
|
||||||
return_value=mock_result,
|
return_value=mock_result,
|
||||||
),
|
),
|
||||||
patch(
|
patch(
|
||||||
"steam_backlog_enforcer.store_blocker.socket.getaddrinfo",
|
"steam_backlog_enforcer._store_iptables.socket.getaddrinfo",
|
||||||
side_effect=socket.gaierror,
|
side_effect=socket.gaierror,
|
||||||
),
|
),
|
||||||
):
|
):
|
||||||
@ -228,11 +228,11 @@ class TestBlockStoreIptables:
|
|||||||
|
|
||||||
with (
|
with (
|
||||||
patch(
|
patch(
|
||||||
"steam_backlog_enforcer.store_blocker.subprocess.run",
|
"steam_backlog_enforcer._store_iptables.subprocess.run",
|
||||||
side_effect=side_effect,
|
side_effect=side_effect,
|
||||||
),
|
),
|
||||||
patch(
|
patch(
|
||||||
"steam_backlog_enforcer.store_blocker.socket.getaddrinfo",
|
"steam_backlog_enforcer._store_iptables.socket.getaddrinfo",
|
||||||
side_effect=__import__("socket").gaierror,
|
side_effect=__import__("socket").gaierror,
|
||||||
),
|
),
|
||||||
):
|
):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user