diff --git a/ui/medashare/cli.py b/ui/medashare/cli.py index ce655e0..d61dad9 100644 --- a/ui/medashare/cli.py +++ b/ui/medashare/cli.py @@ -278,6 +278,13 @@ class _JSONEncoder(json.JSONEncoder): _jsonencoder = _JSONEncoder() +class _TestJSONEncoder(unittest.TestCase): + def test_defaultfailure(self): + class Foo: + pass + + self.assertRaises(TypeError, _jsonencoder.encode, Foo()) + class Persona(object): '''The object that represents a persona, or identity. It will create the proper identity object, serialize for saving keys, diff --git a/ui/medashare/tests.py b/ui/medashare/tests.py index 93147be..db68722 100644 --- a/ui/medashare/tests.py +++ b/ui/medashare/tests.py @@ -1,3 +1,4 @@ from .cli import _TestCononicalCoder, _TestCases as cli_test_cases +from .cli import _TestJSONEncoder from .mtree import Test from .server import _TestCases, _TestPostConfig