Skip to content

Commit

Permalink
Remove filetype parameter from assertRecordsInArchive
Browse files Browse the repository at this point in the history
  • Loading branch information
bensteinberg committed Jan 8, 2025
1 parent 4317059 commit 1d4875f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions perma_web/api/tests/test_link_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def setUp(self):
'private_reason',
]

def assertRecordsInArchive(self, link, upload=False, expected_records=None, check_screenshot=False, check_provenance_summary=False, filetype='wacz'):
def assertRecordsInArchive(self, link, upload=False, expected_records=None, check_screenshot=False, check_provenance_summary=False):

def find_recording_in_warc(index, capture_url, content_type):
warc_content_type = "application/http; msgtype=response"
Expand Down Expand Up @@ -129,8 +129,7 @@ def find_attachment_in_warc(index, capture_url):
self.assertTrue(link.primary_capture.content_type, "Capture is missing a content type.")

# create an index of the warc
extract = filetype == 'wacz'
with link.get_warc(extract) as warc_file:
with link.get_warc() as warc_file:
index = index_warc_file(warc_file)

# see if the index reports the content is in the warc
Expand Down Expand Up @@ -655,7 +654,7 @@ def test_should_create_archive_from_pdf_file(self):
user=self.org_user)

link = Link.objects.get(guid=obj['guid'])
self.assertRecordsInArchive(link, upload=True, filetype='wacz')
self.assertRecordsInArchive(link, upload=True)
self.assertEqual(link.primary_capture.user_upload, True)

def test_should_create_archive_from_jpg_file(self):
Expand All @@ -666,7 +665,7 @@ def test_should_create_archive_from_jpg_file(self):
user=self.org_user)

link = Link.objects.get(guid=obj['guid'])
self.assertRecordsInArchive(link, upload=True, filetype='wacz')
self.assertRecordsInArchive(link, upload=True)
self.assertEqual(link.primary_capture.user_upload, True)

def test_should_reject_jpg_file_with_invalid_url(self):
Expand All @@ -687,7 +686,7 @@ def test_should_should_create_archive_from_jpg_file_with_nonloading_url(self):

link = Link.objects.get(guid=obj['guid'])
self.assertEqual(link.submitted_url, 'http://asdf.asdf')
self.assertRecordsInArchive(link, upload=True, filetype='wacz')
self.assertRecordsInArchive(link, upload=True)
self.assertEqual(link.primary_capture.user_upload, True)

def test_should_reject_invalid_file(self):
Expand Down

0 comments on commit 1d4875f

Please sign in to comment.