Add test for JSON encoding

pull/3/head
Raphaël Vinot 2017-07-26 17:11:17 +02:00
parent b4ba8dcf84
commit 76f06e4210
1 changed files with 5 additions and 1 deletions

View File

@ -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)