diff --git a/launcher/tests/fixtures/bad-os-release-file b/launcher/tests/fixtures/bad-os-release-file new file mode 100644 index 000000000..eca68dfc5 --- /dev/null +++ b/launcher/tests/fixtures/bad-os-release-file @@ -0,0 +1,4 @@ +# No line +VERSION= +[we're doing toml now] +RELEASES = [ ["gamma", "delta"], [1, 2] ] diff --git a/launcher/tests/test_util.py b/launcher/tests/test_util.py index 7488093fd..c9660bb0e 100644 --- a/launcher/tests/test_util.py +++ b/launcher/tests/test_util.py @@ -237,6 +237,7 @@ def test_detect_qubes( ("os-release-qubes-4.1", 5), ("os-release-ubuntu", 4), ("no-such-file", 4), + ("bad-os-release-file", 4), ], ) @mock.patch("Util.sdlog.error") @@ -283,5 +284,7 @@ def test_pick_bad_qt( version via environment override """ mocked_env = {"SDW_UPDATER_QT": env_override} - with mock.patch.dict("os.environ", mocked_env), pytest.raises(ValueError): + with mock.patch.dict("os.environ", mocked_env), mock.patch( + "Util.OS_RELEASE_FILE", os.path.join(FIXTURES_PATH, "os-release-qubes-4.0") + ), pytest.raises(ValueError): util.get_qt_version()