From d4eddbc4a7b46c9e53fdd47b9feff0c2e75ec8d7 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Tue, 22 Sep 2026 13:57:08 +0100 Subject: Permit Mattermost Snap tray communication --- tests/test_mattermost_keyring.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/test_mattermost_keyring.py') diff --git a/tests/test_mattermost_keyring.py b/tests/test_mattermost_keyring.py index 93cc96d..78da9fa 100644 --- a/tests/test_mattermost_keyring.py +++ b/tests/test_mattermost_keyring.py @@ -8,6 +8,23 @@ from scripts import mattermost_keyring class MattermostKeyringTests(unittest.TestCase): + def test_adds_tray_rules_to_existing_keyring_patch(self): + original = ( + 'profile "snap.mattermost-desktop.mattermost-desktop" {\n' + + mattermost_keyring.MARKER + + "\n" + + mattermost_keyring.RULES + + "}\n" + ) + patched = mattermost_keyring.patch_profile(original) + self.assertIn("path=/org/chromium/StatusNotifierItem/[0-9]*", patched) + self.assertIn("interface=org.kde.StatusNotifierItem", patched) + self.assertIn("path=/org/chromium/DbusMenu{,/[0-9]*}", patched) + self.assertEqual(patched.count(mattermost_keyring.MARKER), 1) + self.assertEqual(mattermost_keyring.patch_profile(patched), patched) + self.assertNotIn("IdleMonitor", patched) + self.assertNotIn("smaps_rollup", patched) + def test_adds_rules_only_once(self): original = 'profile "snap.mattermost-desktop.mattermost-desktop" {\n}\n' patched = mattermost_keyring.patch_profile(original) -- cgit v1.3.1