mirror of https://github.com/MISP/PyMISPGalaxies
Add test for JSON encoding
parent
b4ba8dcf84
commit
76f06e4210
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
from pymispgalaxies import Galaxies, Clusters, UnableToRevertMachinetag
|
from pymispgalaxies import Galaxies, Clusters, UnableToRevertMachinetag, EncodeGalaxies
|
||||||
from glob import glob
|
from glob import glob
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
@ -67,3 +67,7 @@ class TestPyMISPGalaxies(unittest.TestCase):
|
||||||
self.assertIsNot(len(self.galaxies), 0)
|
self.assertIsNot(len(self.galaxies), 0)
|
||||||
for c in self.clusters.values():
|
for c in self.clusters.values():
|
||||||
self.assertIsNot(len(c), 0)
|
self.assertIsNot(len(c), 0)
|
||||||
|
|
||||||
|
def test_json(self):
|
||||||
|
for c in self.clusters.values():
|
||||||
|
json.dumps(c, cls=EncodeGalaxies)
|
||||||
|
|
Loading…
Reference in New Issue