mirror of https://github.com/MISP/PyMISPGalaxies
Fix search, add test
parent
a81e0c8653
commit
80ab84f86f
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue