From a1b5c091fe9e5627eebe1240c98355ec5b47c08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 22 Mar 2018 16:20:10 +0100 Subject: [PATCH] chg: Update tests --- tests/tests.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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')):