summaryrefslogtreecommitdiffstats
path: root/deluge/tests/test_ui_gtk3.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 21:38:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 21:38:38 +0000
commit2e2851dc13d73352530dd4495c7e05603b2e520d (patch)
tree622b9cd8e5d32091c9aa9e4937b533975a40356c /deluge/tests/test_ui_gtk3.py
parentInitial commit. (diff)
downloaddeluge-2e2851dc13d73352530dd4495c7e05603b2e520d.tar.xz
deluge-2e2851dc13d73352530dd4495c7e05603b2e520d.zip
Adding upstream version 2.1.2~dev0+20240219.upstream/2.1.2_dev0+20240219upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/tests/test_ui_gtk3.py')
-rw-r--r--deluge/tests/test_ui_gtk3.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/deluge/tests/test_ui_gtk3.py b/deluge/tests/test_ui_gtk3.py
new file mode 100644
index 0000000..e6d025c
--- /dev/null
+++ b/deluge/tests/test_ui_gtk3.py
@@ -0,0 +1,30 @@
+#
+# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
+# the additional special exception to link portions of this program with the OpenSSL library.
+# See LICENSE for more details.
+#
+
+import sys
+from unittest import mock
+
+import pytest
+
+
+@pytest.mark.gtkui
+class TestGTK3Common:
+ def setUp(self):
+ sys.modules['gi.repository'] = mock.MagicMock()
+
+ def tearDown(self):
+ pass
+
+ def test_cmp(self):
+ from deluge.ui.gtk3.common import cmp
+
+ assert cmp(None, None) == 0
+ assert cmp(1, None) == 1
+ assert cmp(0, None) == 1
+ assert cmp(None, 7) == -1
+ assert cmp(None, 'bar') == -1
+ assert cmp('foo', None) == 1
+ assert cmp('', None) == 1