Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_arguments_passed_to_gdb(monkeypatch, test_argv, expected_gdb_args):
def mock_setup_backend(*args, **kwargs):
pass
monkeypatch.setattr(gdbgui.backend, "setup_backend", mock_setup_backend)
monkeypatch.setattr(sys, "argv", test_argv)
gdbgui.backend.main()
state = StateManager(gdbgui.backend.app.config)
assert len(state.get_gdb_args()) == len(expected_gdb_args)