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, 'DocTest.CompareImage.CompareImage', 'CompareImage', (["(testdata_dir / 'text_big.png')"], {}), False, 'from DocTest.CompareImage import CompareImage\n'), (28, 'pytest.raises', 'pytest.raises', (['AssertionError'], {}), False, 'import pytest\n'), (29, 'DocTest.CompareImage.CompareImage', 'CompareImage', (["(testdata_dir / 'does_not_exist.png')"], {}), False, 'from DocTest.CompareImage import CompareImage\n'), (32, 'pytest.raises', 'pytest.raises', (['AssertionError'], {}), False, 'import pytest\n'), (33, 'DocTest.CompareImage.CompareImage', 'CompareImage', (["(testdata_dir / 'corrupt_image.png')"], {}), False, 'from DocTest.CompareImage import CompareImage\n'), (36, 'pytest.raises', 'pytest.raises', (['AssertionError'], {}), False, 'import pytest\n'), (37, 'DocTest.CompareImage.CompareImage', 'CompareImage', (["(testdata_dir / 'corrupt_pdf.pdf')"], {}), False, 'from DocTest.CompareImage import CompareImage\n')]