Пример #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
Пример #3
0
def test_no_wellformed():
    """Test scraper without well-formed check."""
    scraper = WandScraper("tests/data/image_tiff/valid_6.0.tif", False)
    scraper.scrape_file()
    assert not partial_message_included("Skipping scraper", scraper.messages())
    assert scraper.well_formed is None