tmp_path = '/tmp/pytest-of-jenkins/pytest-0/test_deposit_ko_unsupported_ta0'
authenticated_client = <rest_framework.test.APIClient object at 0x7f6e3db08358>
deposit_collection = <DepositCollection: {'id': 104, 'name': 'test'}>
ready_deposit_invalid_archive = <Deposit: {'id': 75, 'reception_date': datetime.datetime(2022, 2, 21, 15, 2, 55, 149281, tzinfo=<UTC>), 'collection': ...', 'origin_url': 'https://hal-test.archives-ouvertes.fr/external-id-invalid', 'client': 'test', 'status': 'deposited'}>
def test_deposit_ko_unsupported_tarball(
tmp_path, authenticated_client, deposit_collection, ready_deposit_invalid_archive
):
"""Deposit with an unsupported tarball should fail the checks: rejected
"""
deposit = ready_deposit_invalid_archive
assert DEPOSIT_STATUS_DEPOSITED == deposit.status
for url in private_check_url_endpoints(deposit_collection, deposit):
response = authenticated_client.get(url)
assert response.status_code == status.HTTP_200_OK
data = response.json()
assert data["status"] == DEPOSIT_STATUS_REJECTED
details = data["details"]
# archive checks failure
assert len(details["archive"]) == 1
assert details["archive"][0]["summary"] == MANDATORY_ARCHIVE_UNSUPPORTED
# metadata check failure
> assert len(details["metadata"]) == 1
E assert 2 == 1
E +2
E -1
.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/api/test_deposit_private_check.py:133: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 21 2022, 4:03 PM