コード例 #1
0
def test_scraper_invalid(filename, mimetype, stderr_part):
    """Test WandScraper with invalid tiff files."""
    scraper = WandScraper(
        os.path.join("tests/data/", mimetype.replace("/", "_"), filename))
    scraper.scrape_file()

    assert not scraper.streams
    assert scraper.info()["class"] == "WandScraper"
    assert not scraper.messages()
    assert partial_message_included(stderr_part, scraper.errors())
    assert not scraper.well_formed
コード例 #2
0
def test_scraper_invalid(filename, mimetype, stderr_part):
    """
    Test WandScraper with invalid files.

    :filename: Test file name
    :mimetype: File MIME type
    :stderr_part: Part of the expected stderr
    """
    scraper = WandScraper(filename=os.path.join("tests/data/",
                                                mimetype.replace("/", "_"),
                                                filename),
                          mimetype=mimetype)
    scraper.scrape_file()

    assert not scraper.streams
    assert scraper.info()["class"] == "WandScraper"
    assert not scraper.messages()
    assert partial_message_included(stderr_part, scraper.errors())
    assert not scraper.well_formed