-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
测试中文名称文件的文件类型识别 |
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,19 @@ | ||
# coding:utf8 | ||
|
||
from pathlib import Path | ||
from xanalyzer.file import FileAnalyzer | ||
|
||
cur_dir_path = Path(__file__).parent | ||
|
||
|
||
def test_common_filetype(): | ||
upxed_path = cur_dir_path / 'test_data' / 'Hello_upx.exe_' | ||
file_analyzer = FileAnalyzer(upxed_path) | ||
assert file_analyzer.get_type() == 'PE32 executable (console) Intel 80386, for MS Windows, UPX compressed' | ||
|
||
|
||
def test_chinese_name_filetype(): | ||
chinese_name_path = cur_dir_path / 'test_data' / '中文名测试.txt' | ||
file_analyzer = FileAnalyzer(chinese_name_path) | ||
file_analyzer.get_type() | ||
assert file_analyzer.get_type() == 'UTF-8 Unicode text, with no line terminators' |
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