aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gui.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_gui.py b/tests/test_gui.py
index eef9c5d..8ffb65d 100644
--- a/tests/test_gui.py
+++ b/tests/test_gui.py
@@ -256,6 +256,19 @@ class FilterTest(unittest.TestCase):
self.assertEqual(pk.vercmp(a, b), want, (a, b))
self.assertEqual(pk.vercmp(b, a), -want, (b, a))
+ def test_hint_kind(self):
+ for hints, want in ((None, ""), ({"SKIP": "yes", "VERSION": "2"}, "skip"),
+ ({"SKIP": "no", "VERSION": "2"}, "pin"),
+ ({"DELREQUIRES": "x", "ADDREQUIRES": "y"}, "deps"),
+ ({"ARCH": "x86_64"}, "other"), ({}, "other"),
+ ({"VERSION": {"value": "$V", "shell": True}}, "pin")):
+ self.assertEqual(pk.hint_kind(hints), want, hints)
+
+ def test_hint_query(self):
+ self.assertEqual(self.names("hint:deps"), ["foo"])
+ self.assertEqual(self.names("hint:none"), ["borgbackup", "curl", "nmap", "nuclei"])
+ self.assertEqual(self.rows["foo"]["hint"], "deps")
+
def test_query(self):
self.assertEqual(pk.parse_query("Nuc cat:misc bogus:x status:"),
[(None, "nuc"), ("category", "misc"), (None, "bogus:x"), (None, "status:")])