diff --git a/convert2rhel/unit_tests/main_test.py b/convert2rhel/unit_tests/main_test.py index 6fa0c00ed9..056c4935a7 100644 --- a/convert2rhel/unit_tests/main_test.py +++ b/convert2rhel/unit_tests/main_test.py @@ -812,7 +812,8 @@ def test_handle_inhibitors_found_exception(monkeypatch, rollback_failures, retur assert ret == return_code -def test_confirm_user_backup(caplog): +@pytest.mark.parametrize("user_input", ["y", "n"]) +def test_confirm_user_backup(caplog, monkeypatch, user_input): message = ( "Convert2RHEL modifies the systems during the analysis and then rolls back these " "changes when the analysis is complete. In rare cases, this rollback can fail. " @@ -820,6 +821,9 @@ def test_confirm_user_backup(caplog): "you can restore from the backup." ) + # Simulate user input + monkeypatch.setattr("builtins.input", lambda _: user_input) + main.confirm_user_backup() assert message in caplog.text