diff --git a/tests/fixtures.py b/tests/fixtures.py index b75d6b22..88a63de1 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -277,6 +277,8 @@ def get_data_path_by_name(name): return os.path.join(DNFILE_TESTFILES, "hello-world", "hello-world.exe") elif name.startswith("_1c444"): return os.path.join(CD, "data", "dotnet", "1c444ebeba24dcba8628b7dfe5fec7c6.exe_") + elif name.startswith("_692f"): + return os.path.join(CD, "data", "dotnet", "692f7fd6d198e804d6af98eb9e390d61.exe_") else: raise ValueError("unexpected sample fixture: %s" % name) @@ -897,3 +899,8 @@ def hello_world_dotnetfile_extractor(): @pytest.fixture def _1c444_dotnetfile_extractor(): return get_dnfile_extractor(get_data_path_by_name("_1c444")) + + +@pytest.fixture +def _692f_dotnetfile_extractor(): + return get_dnfile_extractor(get_data_path_by_name("_692f")) diff --git a/tests/test_main.py b/tests/test_main.py index 056a292d..0acf2b99 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -12,6 +12,7 @@ import textwrap import fixtures from fixtures import * from fixtures import _1c444_dotnetfile_extractor +from fixtures import _692f_dotnetfile_extractor import capa.main import capa.rules @@ -455,3 +456,13 @@ def test_main_dotnet(_1c444_dotnetfile_extractor): assert capa.main.main([path, "-j"]) == 0 assert capa.main.main([path, "-q"]) == 0 assert capa.main.main([path]) == 0 + + +def test_main_dotnet2(_692f_dotnetfile_extractor): + # tests rules can be loaded successfully and all output modes + path = _1c444_dotnetfile_extractor.path + assert capa.main.main([path, "-vv"]) == 0 + assert capa.main.main([path, "-v"]) == 0 + assert capa.main.main([path, "-j"]) == 0 + assert capa.main.main([path, "-q"]) == 0 + assert capa.main.main([path]) == 0