summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bindings/python/lilv.py3
-rw-r--r--bindings/test/python/test_api.py13
2 files changed, 9 insertions, 7 deletions
diff --git a/bindings/python/lilv.py b/bindings/python/lilv.py
index 2ba5c43..595ec00 100644
--- a/bindings/python/lilv.py
+++ b/bindings/python/lilv.py
@@ -1101,6 +1101,9 @@ class Nodes(Collection):
c.nodes_free(self.collection)
def __contains__(self, value):
+ if type(value) in [Plugin, PluginClass, UI]:
+ value = value.get_uri()
+
return c.nodes_contains(self.collection, value.node)
def __len__(self):
diff --git a/bindings/test/python/test_api.py b/bindings/test/python/test_api.py
index aa6545a..4b32f07 100644
--- a/bindings/test/python/test_api.py
+++ b/bindings/test/python/test_api.py
@@ -341,14 +341,13 @@ class QueryTests(unittest.TestCase):
None, self.world.ns.rdf.type, self.world.ns.lv2.Plugin
)
)
- self.assertLess(
- 0,
- len(
- self.world.find_nodes(
- None, self.world.ns.rdf.type, self.world.ns.lv2.Plugin
- )
- ),
+ plugin_nodes = self.world.find_nodes(
+ None, self.world.ns.rdf.type, self.world.ns.lv2.Plugin
)
+
+ self.assertLess(0, len(plugin_nodes))
+ self.assertTrue(self.plugins[0] in plugin_nodes)
+
self.assertEqual(
self.plugin.get_uri(),
self.world.get(