Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormjk <mjk@disroot.org>2022-11-10 18:45:22 +0300
committermjk <mjk@disroot.org>2022-12-07 17:03:40 +0300
commitdfac89f79ff5df54cecf711f6aa3ca6e6d415876 (patch)
treeea5eafedc23c498d91863512665e5fdc577a7767 /test
parentf681bceec2a01f82fa22f58e7815c223905744b0 (diff)
refactor: Make URI context menus more data-driven
...and cover missing URITypes, adding "coverage" tests.
Diffstat (limited to 'test')
-rw-r--r--test/no_gui/test_gtk_menus.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/no_gui/test_gtk_menus.py b/test/no_gui/test_gtk_menus.py
new file mode 100644
index 000000000..52c2e8be5
--- /dev/null
+++ b/test/no_gui/test_gtk_menus.py
@@ -0,0 +1,25 @@
+import unittest
+
+from gajim import gui
+gui.init('gtk')
+
+from gajim.common.const import URIType
+from gajim.common.const import XmppUriQuery
+from gajim.gtk.menus import _uri_context_menus
+from gajim.gtk.menus import _xmpp_uri_context_menus
+
+
+class Test(unittest.TestCase):
+ def test_uri_menus_dict(self):
+ for t in URIType:
+ if t == URIType.INVALID:
+ continue # doesn't need to be present
+ self.assertIn(t, _uri_context_menus)
+
+ def test_xmpp_uri_menus_dict(self):
+ for t in XmppUriQuery:
+ self.assertIn(t, _xmpp_uri_context_menus)
+
+
+if __name__ == '__main__':
+ unittest.main()