From db958a8a148c82df4697001bdfa8827a8b96a659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 6 May 2019 17:18:29 +0200 Subject: [PATCH] chg: Bump deps & misp-galaxy. Add test case. --- .travis.yml | 1 + Pipfile | 2 +- Pipfile.lock | 14 +++++++------- pymispgalaxies/data/misp-galaxy | 2 +- tests/tests.py | 19 ++++++++++++++++++- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 41e1bfa..f196bd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ cache: pip python: - "3.6" - "3.6-dev" + - "3.7-dev" - "nightly" install: diff --git a/Pipfile b/Pipfile index cc540a3..f3092fb 100644 --- a/Pipfile +++ b/Pipfile @@ -13,4 +13,4 @@ nose = "*" pymispgalaxies = {editable = true,path = "."} [requires] -python_version = "3.6" +python_version = "3" diff --git a/Pipfile.lock b/Pipfile.lock index f316223..41ede6e 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "0fcd71c6a32074302df9734b9c3138fb602fbc3ae038900db73ad01ac7540219" + "sha256": "36c131705fba0ee72c16a9fbf57422cd31be9e2f87bd97e4d0ea87d22dbbae00" }, "pipfile-spec": 6, "requires": { - "python_version": "3.6" + "python_version": "3" }, "sources": [ { @@ -127,9 +127,9 @@ }, "pyrsistent": { "hashes": [ - "sha256:3ca82748918eb65e2d89f222b702277099aca77e34843c5eb9d52451173970e2" + "sha256:5403d37f4d55ff4572b5b5676890589f367a9569529c6f728c11046c4ea4272b" ], - "version": "==0.14.11" + "version": "==0.15.1" }, "requests": { "hashes": [ @@ -147,10 +147,10 @@ }, "urllib3": { "hashes": [ - "sha256:4c291ca23bbb55c76518905869ef34bdd5f0e46af7afe6861e8375643ffee1a0", - "sha256:9a247273df709c4fedb38c711e44292304f73f39ab01beda9f6b9fc375669ac3" + "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4", + "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb" ], - "version": "==1.24.2" + "version": "==1.24.3" } } } diff --git a/pymispgalaxies/data/misp-galaxy b/pymispgalaxies/data/misp-galaxy index ecc63cf..988586f 160000 --- a/pymispgalaxies/data/misp-galaxy +++ b/pymispgalaxies/data/misp-galaxy @@ -1 +1 @@ -Subproject commit ecc63cf1665c49705dac2644800f0122d06b5b1d +Subproject commit 988586fde0ee119cb0629e5155ceb9437a48f65b diff --git a/tests/tests.py b/tests/tests.py index a238fa2..3f6de71 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -6,7 +6,7 @@ from pymispgalaxies import Galaxies, Clusters, UnableToRevertMachinetag from glob import glob import os import json -from collections import Counter +from collections import Counter, defaultdict import warnings @@ -96,3 +96,20 @@ class TestPyMISPGalaxies(unittest.TestCase): g.to_json() for c in self.clusters.values(): c.to_json() + + def test_uuids(self): + all_uuids = defaultdict(list) + for cluster in self.clusters.values(): + # Skip deprecated + if self.galaxies[cluster.name].namespace == 'deprecated': + continue + all_uuids[cluster.uuid].append(cluster.name) + for value in cluster.values(): + all_uuids[value.uuid].append(f'{cluster.name}|{value.value}') + + errors = {} + for uuid, entries in all_uuids.items(): + if len(entries) != 1: + errors[uuid] = entries + print(json.dumps(errors, indent=2)) + self.assertFalse(errors)