diff --git a/pymispgalaxies/api.py b/pymispgalaxies/api.py index f6a3bc0..a49e6bf 100644 --- a/pymispgalaxies/api.py +++ b/pymispgalaxies/api.py @@ -202,7 +202,7 @@ class Cluster(collections.Mapping): def search(self, query): matching = [] - for v in self.values: + for v in self.values.values(): if [s for s in v.searchable if query.lower() in s.lower()]: matching.append(v) return matching diff --git a/tests/tests.py b/tests/tests.py index dd298a3..8c125b4 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -53,3 +53,6 @@ class TestPyMISPGalaxies(unittest.TestCase): def test_print(self): print(self.clusters) + + def test_search(self): + self.assertIsNot(len(self.clusters.search('apt')), 0)