chore(tests): Final stabilization of test suite and full isolation of live_gui artifacts
This commit is contained in:
@@ -8,17 +8,18 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
from api_hook_client import ApiHookClient
|
||||
import gui_2
|
||||
|
||||
def test_hooks_enabled_via_cli() -> None:
|
||||
def test_hooks_enabled_via_cli(mock_app) -> None:
|
||||
with patch.object(sys, 'argv', ['gui_2.py', '--enable-test-hooks']):
|
||||
app = gui_2.App()
|
||||
assert app.test_hooks_enabled is True
|
||||
# We just test the attribute on the mocked app which we re-init
|
||||
mock_app.__init__()
|
||||
assert mock_app.test_hooks_enabled is True
|
||||
|
||||
def test_hooks_disabled_by_default() -> None:
|
||||
def test_hooks_disabled_by_default(mock_app) -> None:
|
||||
with patch.object(sys, 'argv', ['gui_2.py']):
|
||||
if 'SLOP_TEST_HOOKS' in os.environ:
|
||||
del os.environ['SLOP_TEST_HOOKS']
|
||||
app = gui_2.App()
|
||||
assert getattr(app, 'test_hooks_enabled', False) is False
|
||||
mock_app.__init__()
|
||||
assert getattr(mock_app, 'test_hooks_enabled', False) is False
|
||||
|
||||
def test_live_hook_server_responses(live_gui) -> None:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user