Esempio n. 1
0
def test_bup_plain():
    assert f("bup_test.bup").magic.startswith(("Composite Document File V2", "CDF V2 Document"))
    t = BupFile(f("bup_test.bup"))
    assert t.handles() is True
    assert not t.f.selected
    files = list(t.unpack())

    assert len(files) == 1
    assert files[0].relapath == "efax_9057733019_pdf.zip"
    assert "Zip archive" in files[0].magic
    assert files[0].parentdirs == []
    assert files[0].package is None
    assert not files[0].selected

    assert len(files[0].children) == 1
    assert files[0].children[0].relapath == "efax_9057733019_pdf.scr"
    assert files[0].children[0].filesize == 377856
    assert files[0].children[0].package == "exe"
    assert files[0].children[0].selected is True
Esempio n. 2
0
def test_bup_plain():
    assert f("bup_test.bup").magic.startswith(
        ("Composite Document File V2", "CDF V2 Document"))
    t = BupFile(f("bup_test.bup"))
    assert t.handles() is True
    assert not t.f.selected
    files = list(t.unpack())

    assert len(files) == 1
    assert not files[0].filepath
    assert files[0].relapath == "efax_9057733019_pdf.zip"
    assert "Zip archive" in files[0].magic
    assert files[0].parentdirs == []
    assert files[0].extension == "zip"
    assert files[0].platforms == [{
        "platform": "windows",
        "os_version": ""
    }, {
        "platform": "darwin",
        "os_version": ""
    }, {
        "platform": "linux",
        "os_version": ""
    }, {
        "platform": "android",
        "os_version": ""
    }, {
        "platform": "ios",
        "os_version": ""
    }]
    assert not files[0].selected

    assert len(files[0].children) == 1
    assert not files[0].children[0].filepath
    assert files[0].children[0].relapath == "efax_9057733019_pdf.scr"
    assert files[0].children[0].filesize == 377856
    assert files[0].children[0].extension == "exe"
    assert files[0].children[0].platforms == [{
        "platform": "windows",
        "os_version": ""
    }]
    assert files[0].children[0].selected is True
Esempio n. 3
0
def test_bup_plain():
    assert f("bup_test.bup").magic.startswith(
        ("Composite Document File V2", "CDF V2 Document"))
    t = BupFile(f("bup_test.bup"))
    assert t.handles() is True
    assert not t.f.selected
    files = list(t.unpack())

    assert len(files) == 1
    assert files[0].relapath == "efax_9057733019_pdf.zip"
    assert "Zip archive" in files[0].magic
    assert files[0].parentdirs == []
    assert files[0].package is None
    assert not files[0].selected

    assert len(files[0].children) == 1
    assert files[0].children[0].relapath == "efax_9057733019_pdf.scr"
    assert files[0].children[0].filesize == 377856
    assert files[0].children[0].package == "exe"
    assert files[0].children[0].selected is True
Esempio n. 4
0
def test_garbage():
    t = BupFile(f(b"garbage.bin"))
    assert t.handles() is False
    assert not t.f.selected
    assert not t.unpack()
    assert t.f.mode == "failed"
Esempio n. 5
0
def test_garbage():
    t = BupFile(f("garbage.bin"))
    assert t.handles() is False
    assert not t.f.selected
    assert not t.unpack()
    assert t.f.mode == "failed"
Esempio n. 6
0
def test_garbage():
    t = BupFile(f("garbage.bin"))
    assert t.handles() is False
    assert not t.f.selected
    assert not t.unpack()
    assert t.f.mode == Errors.UNPACK_FAILED