示例#1
0
def test_pdf_embedded():
    assert f("pdf_docm.pdf").magic.startswith("PDF document")
    m = PdfFile(f("pdf_docm.pdf"))
    assert m.handles() is True
    assert m.f.selected
    files = list(m.unpack())
    assert m.f.extension == "pdf"

    assert len(files) == 1
    assert not files[0].filepath
    assert files[0].filename == "Q6TCWXPS.docm"
    assert files[0].filesize == 55494
    assert files[0].extension == "docm"
    assert files[0].selected
    assert len(files[0].children) == 18
示例#2
0
文件: test_pdf.py 项目: snemes/sflock
def test_garbage():
    m = PdfFile(f("garbage.bin"))
    assert m.handles() is False
    assert not m.f.selected
    assert not m.unpack()
示例#3
0
文件: test_pdf.py 项目: snemes/sflock
def test_pdf_magic():
    m = PdfFile(File(contents=f("pdf_docm.pdf").contents))
    assert m.handles() is True
示例#4
0
def test_bypass_minimized():
    m = PdfFile(f(b"bypass_minimized.pdf"))
    files = list(m.unpack())
    assert len(files) == 1
    assert files[0].filename == b"test.txt"