Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,14 @@ def test_get_type(self, test_files):
[
("temp_pe32", "PE32 executable (GUI) Intel 80386, for MS Windows", True), # emulated magic type
("temp_pe64", "PE32+ executable (GUI) x86-64, for MS Windows", True), # emulated magic type
# Broken we remove "MS-DOS executable"
# ("temp_pe_aarch64", "MS-DOS executable PE32 executable Aarch64, for MS Windows", True),
("temp_pe_aarch64", "PE32 executable Aarch64, for MS Windows", True),
(
"temp_pe_aarch64",
(
"PE32 executable Aarch64, for MS Windows",
"MS-DOS executable PE32 executable Aarch64, for MS Windows",
),
True,
),
("temp_elf32", "ELF 32-bit LSB", False),
("temp_elf64", "ELF 64-bit LSB", False),
("temp_macho_arm64", "Mach-O 64-bit arm64 executable", False),
Expand All @@ -234,7 +239,9 @@ def test_get_type(self, test_files):
def test_get_type_pe(self, file_fixture, expected, is_pe, request):
path = request.getfixturevalue(file_fixture)
file = File(path)
assert file.get_type() == expected
if isinstance(expected, str):
expected = (expected,)
assert file.get_type() in expected
assert bool(file.pe) == is_pe

def test_get_yara(self, hello_file, yara_compiled):
Expand Down