Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_cassandra.TestCassandraStorage::test_revision_add_from_generator
Failed

TEST RESULT

Run At
Jul 9 2020, 10:49 AM
Details
self = <swh.storage.tests.test_cassandra.TestCassandraStorage object at 0x7f1d74624ef0> swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7f1d54056518> def test_revision_add_from_generator(self, swh_storage): def _rev_gen(): yield data.revision > actual_result = swh_storage.revision_add(_rev_gen()) .tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_storage.py:960: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/storage/validate.py:104: in revision_add [dict_converter(Revision, r) for r in revisions] .tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:433: in revision_add revobject = revision_to_db(revision) .tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/converters.py:38: in revision_to_db db_revision["metadata"] = json.dumps(db_revision["metadata"]) /usr/lib/python3.7/json/__init__.py:231: in dumps return _default_encoder.encode(obj) /usr/lib/python3.7/json/encoder.py:199: in encode chunks = self.iterencode(o, _one_shot=True) /usr/lib/python3.7/json/encoder.py:257: in iterencode return _iterencode(o, 0) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <json.encoder.JSONEncoder object at 0x7f1d7fd98cc0> o = <swh.model.collections.ImmutableDict object at 0x7f1d746564a8> def default(self, o): """Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) """ > raise TypeError(f'Object of type {o.__class__.__name__} ' f'is not JSON serializable') E TypeError: Object of type ImmutableDict is not JSON serializable /usr/lib/python3.7/json/encoder.py:179: TypeError