diff --git a/tests/tests.py b/tests/tests.py index 273051e..53b2764 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -6,15 +6,26 @@ from pymispgalaxies import Galaxies, Clusters, UnableToRevertMachinetag from glob import glob import os import json +from collections import Counter class TestPyMISPGalaxies(unittest.TestCase): def setUp(self): self.galaxies = Galaxies() - self.clusters = Clusters() + self.clusters = Clusters(skip_duplicates=True) self.maxDiff = None + def test_duplicates(self): + has_duplicates = False + for name, c in self.clusters.items(): + if c.duplicates: + has_duplicates = True + to_print = Counter(c.duplicates) + for entry, counter in to_print.items(): + print(counter + 1, entry) + self.assertFalse(has_duplicates) + def test_dump_galaxies(self): galaxies_from_files = {} for galaxy_file in glob(os.path.join(self.galaxies.root_dir_galaxies, '*.json')):