summaryrefslogtreecommitdiffstatshomepage
path: root/tests/test_canonical.py
diff options
context:
space:
mode:
authorsommerfeld <sommerfeld@sommerfeld.dev>2026-09-18 08:58:12 +0100
committersommerfeld <sommerfeld@sommerfeld.dev>2026-09-18 08:58:12 +0100
commit0bb7afe1e5e6e3240e6d6211b01c1674a363347c (patch)
tree35183dba6b244b31469104795f9922bcd3eacf37 /tests/test_canonical.py
parentf5f9bdee476114e4f345de320631aee9ea247861 (diff)
downloaddotfiles-0bb7afe1e5e6e3240e6d6211b01c1674a363347c.tar.gz
dotfiles-0bb7afe1e5e6e3240e6d6211b01c1674a363347c.tar.bz2
dotfiles-0bb7afe1e5e6e3240e6d6211b01c1674a363347c.zip
Assign missing subordinate IDs during corporate setup
Diffstat (limited to 'tests/test_canonical.py')
-rw-r--r--tests/test_canonical.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_canonical.py b/tests/test_canonical.py
index 27fd199..14b7a3c 100644
--- a/tests/test_canonical.py
+++ b/tests/test_canonical.py
@@ -17,6 +17,23 @@ SPEC.loader.exec_module(canonical)
class PackageTests(unittest.TestCase):
+ def test_subid_failure_remains_fatal_with_setup_guidance(self):
+ def result(command, **kwargs):
+ return subprocess.CompletedProcess(
+ command, int(command[0] == "/usr/bin/getsubids")
+ )
+
+ with (
+ patch.object(canonical.subprocess, "run", side_effect=result),
+ patch("builtins.print") as printed,
+ self.assertRaises(SystemExit) as failure,
+ ):
+ canonical.check()
+ self.assertEqual(failure.exception.code, 1)
+ self.assertTrue(
+ any("just canonical-system" in str(call) for call in printed.call_args_list)
+ )
+
def test_install_does_not_enable_experimental_snap_features(self):
with patch.object(canonical.subprocess, "run") as command:
canonical.install()