def test_handles_weird_config_nicely(self): with patch( "os.environ", { "SCANNER_CONFIG_LOCATION": f"{self.test_dir_data}/config_with_unknown_part.yaml" }): with open(file=os.getenv("SCANNER_CONFIG_LOCATION"), mode="r") as f: session = Session(f) assert len(session.signatures) == 2 sig = session.signatures[0] match, part = sig.match( path="/sample/path/filezilla.xml", filename="filezilla.xml", extension="xml", content="", ) assert isinstance(sig, SimpleSignature) assert match is False assert part == "" sig_2 = session.signatures[1] match, part = sig.match( path="/sample/path/filezilla.xml", filename="filezilla.xml", extension="xml", content="", ) assert isinstance(sig_2, PatternSignature) assert match is False assert part == ""