-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actually expose magic compat module, version 0.3.4
- Loading branch information
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Copyright (C) 2015-2017 Jurriaan Bremer. | ||
# Copyright (C) 2015-2018 Jurriaan Bremer. | ||
# This file is part of SFlock - http://www.sflock.org/. | ||
# See the file 'docs/LICENSE.txt' for copying permission. | ||
|
||
from sflock.compat import magic | ||
from sflock.exception import UnpackException | ||
from sflock.main import ident, unpack, supported, zipify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (C) 2018 Jurriaan Bremer. | ||
# This file is part of SFlock - http://www.sflock.org/. | ||
# See the file 'docs/LICENSE.txt' for copying permission. | ||
|
||
from sflock import magic | ||
|
||
def test_magic(): | ||
assert magic.from_file("tests/files/maldoc.xls").startswith(( | ||
"Composite Document File V2", "CDF V2 Document" | ||
)) | ||
assert magic.from_file("tests/files/test.hta_").startswith( | ||
"HTML document" | ||
) | ||
assert magic.from_file("tests/files/cab2.cab").startswith( | ||
"Microsoft Cabinet" | ||
) |