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):
|
def search(self, query):
|
||||||
matching = []
|
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()]:
|
if [s for s in v.searchable if query.lower() in s.lower()]:
|
||||||
matching.append(v)
|
matching.append(v)
|
||||||
return matching
|
return matching
|
||||||
|
|
|
@ -53,3 +53,6 @@ class TestPyMISPGalaxies(unittest.TestCase):
|
||||||
|
|
||||||
def test_print(self):
|
def test_print(self):
|
||||||
print(self.clusters)
|
print(self.clusters)
|
||||||
|
|
||||||
|
def test_search(self):
|
||||||
|
self.assertIsNot(len(self.clusters.search('apt')), 0)
|
||||||
|
|
Loading…
Reference in New Issue