def test_archive_file_bigger_than_header(tmpfile, random_metadata): # NB: tmpfile casts content to string. So we don't need the content in this # test to be bytes. content = 'x' * 1024 + 'y' * 1024 f = open(tmpfile(content)) af = ArchiveFile(f, random_metadata) assert af.read() == content assert af.read() == ''
def test_archive_file_read_twice(tmpfile, random_metadata): # NB: tmpfile casts content to string. So we don't need the content in this # test to be bytes. content = 'it was the best of times, it was the worst of times' f = open(tmpfile(content)) af = ArchiveFile(f, random_metadata) assert af.read() == content assert af.read() == ''
def test_archive_file_bigger_than_header(tmpfile, random_metadata): content = 'x' * 1024 + 'y' * 1024 f = open(tmpfile(content)) af = ArchiveFile(f, random_metadata) assert af.read() == content assert af.read() == ''
def test_archive_file_read_twice(tmpfile, random_metadata): content = 'it was the best of times, it was the worst of times' f = open(tmpfile(content)) af = ArchiveFile(f, random_metadata) assert af.read() == content assert af.read() == ''