diff --git a/src/bot/command_guard.py b/src/bot/command_guard.py index b22531f2..7702eaaf 100644 --- a/src/bot/command_guard.py +++ b/src/bot/command_guard.py @@ -98,6 +98,4 @@ class CommandGuard: return True def ensure_access_and_points(self, message: Any, cost: int, command_label: str) -> bool: - if not self.ensure_group_member(message, command_label): - return False return self.io_layer.ensure_query_points(message, cost, command_label) diff --git a/tests/test_bot_command_guard.py b/tests/test_bot_command_guard.py index 55ffa53c..1461c6d1 100644 --- a/tests/test_bot_command_guard.py +++ b/tests/test_bot_command_guard.py @@ -11,22 +11,7 @@ def _message(): ) -def test_guard_blocks_non_member_before_points_charge(): - fake_bot = SimpleNamespace( - reply_to=Mock(), - get_chat_member=Mock(return_value=SimpleNamespace(status="left")), - ) - io_layer = SimpleNamespace(bot=fake_bot, ensure_query_points=Mock(return_value=True)) - guard = CommandGuard(io_layer=io_layer, group_chat_id="-100123") - - ok = guard.ensure_access_and_points(_message(), 1, "/city") - - assert ok is False - assert io_layer.ensure_query_points.call_count == 0 - assert fake_bot.reply_to.call_count == 1 - - -def test_guard_allows_member_then_charges_points(): +def test_guard_charges_points(): fake_bot = SimpleNamespace( reply_to=Mock(), get_chat_member=Mock(return_value=SimpleNamespace(status="member")),