from DocTest.CompareImage import CompareImage
import pytest
from pathlib import Path
import numpy

def test_single_png(testdata_dir):
    img = CompareImage(testdata_dir / 'text_big.png')
    assert len(img.opencv_images)==1
    assert type(img.opencv_images)==list
    type(img.opencv_images[0])==numpy.ndarray

def test_single_pdf(testdata_dir):
    pass

def test_multipage_pdf(testdata_dir):
    pass

def test_huge_pdf(testdata_dir):
    pass

def test_image_text_content(testdata_dir):
    pass

def test_pdf_text_content(testdata_dir):
    pass

def test_non_existing_file(testdata_dir):
    with pytest.raises(AssertionError):
        img = CompareImage(testdata_dir / 'does_not_exist.png')
        
def test_corrupt_image(testdata_dir):
    with pytest.raises(AssertionError):
        img = CompareImage(testdata_dir / 'corrupt_image.png')

def test_corrupt_pdf(testdata_dir):
    with pytest.raises(AssertionError):
        img = CompareImage(testdata_dir / 'corrupt_pdf.pdf')

[((7, 10, 7, 53), 'DocTest.CompareImage.CompareImage', 'CompareImage', ({(7, 23, 7, 52): "testdata_dir / 'text_big.png'"}, {}), "(testdata_dir / 'text_big.png')", False, 'from DocTest.CompareImage import CompareImage\n'), ((28, 9, 28, 38), 'pytest.raises', 'pytest.raises', ({(28, 23, 28, 37): 'AssertionError'}, {}), '(AssertionError)', False, 'import pytest\n'), ((29, 14, 29, 63), 'DocTest.CompareImage.CompareImage', 'CompareImage', ({(29, 27, 29, 62): "testdata_dir / 'does_not_exist.png'"}, {}), "(testdata_dir / 'does_not_exist.png')", False, 'from DocTest.CompareImage import CompareImage\n'), ((32, 9, 32, 38), 'pytest.raises', 'pytest.raises', ({(32, 23, 32, 37): 'AssertionError'}, {}), '(AssertionError)', False, 'import pytest\n'), ((33, 14, 33, 62), 'DocTest.CompareImage.CompareImage', 'CompareImage', ({(33, 27, 33, 61): "testdata_dir / 'corrupt_image.png'"}, {}), "(testdata_dir / 'corrupt_image.png')", False, 'from DocTest.CompareImage import CompareImage\n'), ((36, 9, 36, 38), 'pytest.raises', 'pytest.raises', ({(36, 23, 36, 37): 'AssertionError'}, {}), '(AssertionError)', False, 'import pytest\n'), ((37, 14, 37, 60), 'DocTest.CompareImage.CompareImage', 'CompareImage', ({(37, 27, 37, 59): "testdata_dir / 'corrupt_pdf.pdf'"}, {}), "(testdata_dir / 'corrupt_pdf.pdf')", False, 'from DocTest.CompareImage import CompareImage\n')]