chg: Bump deps & misp-galaxy. Add test case.

pull/5/head
Raphaël Vinot 2019-05-06 17:18:29 +02:00
parent d305fde342
commit db958a8a14
5 changed files with 28 additions and 10 deletions

View File

@ -5,6 +5,7 @@ cache: pip
python: python:
- "3.6" - "3.6"
- "3.6-dev" - "3.6-dev"
- "3.7-dev"
- "nightly" - "nightly"
install: install:

View File

@ -13,4 +13,4 @@ nose = "*"
pymispgalaxies = {editable = true,path = "."} pymispgalaxies = {editable = true,path = "."}
[requires] [requires]
python_version = "3.6" python_version = "3"

14
Pipfile.lock generated
View File

@ -1,11 +1,11 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "0fcd71c6a32074302df9734b9c3138fb602fbc3ae038900db73ad01ac7540219" "sha256": "36c131705fba0ee72c16a9fbf57422cd31be9e2f87bd97e4d0ea87d22dbbae00"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
"python_version": "3.6" "python_version": "3"
}, },
"sources": [ "sources": [
{ {
@ -127,9 +127,9 @@
}, },
"pyrsistent": { "pyrsistent": {
"hashes": [ "hashes": [
"sha256:3ca82748918eb65e2d89f222b702277099aca77e34843c5eb9d52451173970e2" "sha256:5403d37f4d55ff4572b5b5676890589f367a9569529c6f728c11046c4ea4272b"
], ],
"version": "==0.14.11" "version": "==0.15.1"
}, },
"requests": { "requests": {
"hashes": [ "hashes": [
@ -147,10 +147,10 @@
}, },
"urllib3": { "urllib3": {
"hashes": [ "hashes": [
"sha256:4c291ca23bbb55c76518905869ef34bdd5f0e46af7afe6861e8375643ffee1a0", "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4",
"sha256:9a247273df709c4fedb38c711e44292304f73f39ab01beda9f6b9fc375669ac3" "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb"
], ],
"version": "==1.24.2" "version": "==1.24.3"
} }
} }
} }

@ -1 +1 @@
Subproject commit ecc63cf1665c49705dac2644800f0122d06b5b1d Subproject commit 988586fde0ee119cb0629e5155ceb9437a48f65b

View File

@ -6,7 +6,7 @@ from pymispgalaxies import Galaxies, Clusters, UnableToRevertMachinetag
from glob import glob from glob import glob
import os import os
import json import json
from collections import Counter from collections import Counter, defaultdict
import warnings import warnings
@ -96,3 +96,20 @@ class TestPyMISPGalaxies(unittest.TestCase):
g.to_json() g.to_json()
for c in self.clusters.values(): for c in self.clusters.values():
c.to_json() 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)