Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_deposit_update::test_replace_archive_to_deposit_is_possible
Failed

TEST RESULT

Run At
May 28 2020, 1:34 PM
Details
tmp_path = '/tmp/pytest-of-jenkins/pytest-0/test_replace_archive_to_deposi0' partial_deposit = <Deposit: {'id': 62, 'reception_date': datetime.datetime(2020, 5, 28, 11, 34, 11, 619458, tzinfo=<UTC>), 'collection': 'test', 'external_id': 'external-id-partial', 'client': 'test', 'status': 'partial'}> deposit_collection = <DepositCollection: {'id': 75, 'name': 'test'}> authenticated_client = <rest_framework.test.APIClient object at 0x7fdb8c8a5438> sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00E\\\xbcP\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1so...ytest-0/test_replace_archive_to_deposi0/tmpa1up_oej', 'length': 128, 'md5sum': '70ed7f20960beb2bf29bca929030f257', ...} atom_dataset = {'codemeta-sample': '<?xml version="1.0"?>\n <entry xmlns="http://www.w3.org/2005/Atom"\n xmlns:d...ntry>\n', 'entry-data-empty-body': '<?xml version="1.0"?>\n<entry xmlns="http://www.w3.org/2005/Atom"></entry>\n', ...} def test_replace_archive_to_deposit_is_possible( tmp_path, partial_deposit, deposit_collection, authenticated_client, sample_archive, atom_dataset, ): """Replace all archive with another one should return a 204 response """ tmp_path = str(tmp_path) # given deposit = partial_deposit requests = DepositRequest.objects.filter(deposit=deposit, type="archive") assert len(list(requests)) == 1 > check_archive(sample_archive["name"], requests[0].archive.name) .tox/py3/lib/python3.7/site-packages/swh/deposit/tests/api/test_deposit_update.py:33: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ archive_name = 'archive1.zip', archive_name_to_check = 'client_74/archive1.zip' def check_archive(archive_name: str, archive_name_to_check: str): """Helper function to ensure archive_name is present within the archive_name_to_check. Raises: AssertionError if archive_name is not present within archive_name_to_check """ pattern = re.compile(".*/.*_%s" % archive_name) > assert pattern.match(archive_name_to_check) is not None E AssertionError: assert None is not None E + where None = <built-in method match of re.Pattern object at 0x7fdb8ca3b490>('client_74/archive1.zip') E + where <built-in method match of re.Pattern object at 0x7fdb8ca3b490> = re.compile('.*/.*_archive1.zip').match .tox/py3/lib/python3.7/site-packages/swh/deposit/tests/common.py:137: AssertionError