Esempio n. 1
0
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() == ''
Esempio n. 2
0
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() == ''
Esempio n. 3
0
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() == ''
Esempio n. 4
0
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() == ''
Esempio n. 5
0
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() == ''
Esempio n. 6
0
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() == ''