def test_scraper_valid_file(filename, mimetype, evaluate_scraper): """ Test valid files with scraper. :filename: Test file name :mimetype: File MIME type """ correct = parse_results(filename, mimetype, {}, True) scraper = OfficeScraper(filename=correct.filename, mimetype=mimetype) scraper.scrape_file() correct.update_mimetype(UNAV) correct.update_version(UNAV) evaluate_scraper(scraper, correct, False) assert scraper.messages() assert not scraper.errors()
def test_scraper_valid_file(filename, mimetype, evaluate_scraper): """Test valid files with scraper.""" result_dict = { "purpose": "Test valid file.", "stdout_part": "", "stderr_part": "" } correct = parse_results(filename, mimetype, result_dict, True) scraper = OfficeScraper(correct.filename, True, correct.params) scraper.scrape_file() correct.streams[0]["version"] = "(:unav)" correct.streams[0]["mimetype"] = "(:unav)" evaluate_scraper(scraper, correct, False) assert scraper.messages() assert not scraper.errors()