Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.api.views.test_snapshot::Tests / Python tests / test_api_snapshot_null_branch
Failed

TEST RESULT

Run At
Aug 7 2020, 2:30 PM
Details
api_client = <rest_framework.test.APIClient object at 0x7fbe668c57b8> archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7fbe6beb4cc0> @given(new_snapshot(min_size=4)) > def test_api_snapshot_null_branch(api_client, archive_data, new_snapshot): .tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_snapshot.py:156: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ api_client = <rest_framework.test.APIClient object at 0x7fbe668c57b8> archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7fbe6beb4cc0> new_snapshot = Snapshot(branches=ImmutableDict({b'\x00': SnapshotBranch(target=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...arget_type=<TargetType.CONTENT: 'content'>)}), id=b'\x9a\x83\xf1\x81v\x1b1\xdcGs\xaf\xad\x12\xd6\xf6\xd4A\xd9\xde\x15') @given(new_snapshot(min_size=4)) def test_api_snapshot_null_branch(api_client, archive_data, new_snapshot): snp_dict = new_snapshot.to_dict() snp_id = hash_to_hex(snp_dict["id"]) for branch in snp_dict["branches"].keys(): snp_dict["branches"][branch] = None break archive_data.snapshot_add([Snapshot.from_dict(snp_dict)]) url = reverse("api-1-snapshot", url_args={"snapshot_id": snp_id}) rv = api_client.get(url) > assert rv.status_code == 200, rv.data E AssertionError: {'exception': 'AttributeError', 'reason': "'dict' object has no attribute 'to_dict'"} E assert 500 == 200 E +500 E -200 .tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_snapshot.py:165: AssertionError