def TestOneInput(input_bytes): # We need to make the file an absolute path testfile_path = os.path.join(os.getcwd(), "testfile.desktop") with open(testfile_path, "wb") as f: f.write(input_bytes) # Test DesktopEntry implementation de = DesktopEntry() try: de.parse(testfile_path) except ParsingError as e: os.remove(testfile_path) return de.checkKey(fdp.ConsumeString(20), "value", "core") os.remove(testfile_path)