test: verify independent guests and recovery on private displays

This commit is contained in:
Codex
2026-10-13 04:35:14 +03:00
parent 623ecdef85
commit 7353c4ec92
11 changed files with 608 additions and 47 deletions
+5
View File
@@ -33,6 +33,11 @@ class ProfilesTests(unittest.TestCase):
with self.subTest(field=field, value=value), self.assertRaises(ValueError):
Profile('guest', self.iso, **{field: value})
def test_invalid_media_path_types(self):
for iso in (True, 42, ''):
with self.subTest(iso=iso), self.assertRaises(ValueError):
Profile('guest', iso)
def test_duplicate_profile_preserves_existing(self):
dest = self.root / 'guest.toml'
save_profile(dest, Profile('guest', self.iso))
+2 -1
View File
@@ -82,7 +82,8 @@ class SessionTests(unittest.TestCase):
self.assertEqual(main(base + ['view', 'alpha']), 1)
self.assertIn('viewer', error.getvalue().lower())
def test_windowed_viewer_exit_leaves_vm_control_untouched(self):
def test_windowed_viewer_exit_with_missing_iso_leaves_vm_control_untouched(self):
self.iso.unlink()
viewer = self.root / 'fake-viewer'
viewer.write_text('#!/bin/sh\ncase "$1" in --help) echo --hide-toolbar; exit 0;; esac\nexit 7\n')
viewer.chmod(0o700)