def test_zero_intensity(): sharpen("pixfixPy/test/test_img/sharpen/test_img1.png", 0, "pixfixPy/test/test_img/sharpen/sharpen.png") output_img = skimage.io.imread( "pixfixPy/test/test_img/sharpen/sharpen.png")[:, :, :3] assert np.array_equal( output_img, test_img1), "Images should be indentical with 0 intensity."
def test_correct_sharpen(): sharpen("pixfixPy/test/test_img/sharpen/test_img1.png", 5, "pixfixPy/test/test_img/sharpen/expected_img1.png") output_img = skimage.io.imread( "pixfixPy/test/test_img/sharpen/testImg1_output.png")[:, :, :3] assert np.array_equal( output_img, expected_img1 ), "The image returned should be identical with 0 intensity."
def test_output_path_valid(): with pytest.raises(FileNotFoundError): sharpen("pixfixPy/test/test_img/sharpen/test_img1.png", 5, "@( * O * )@")
def test_input_exist(): with pytest.raises(FileExistsError): sharpen("pixfixPy/test/test_img/ffxiv/namazu.png", 5, "pixfixPy/test/test_img/sharpen/sharpen.png")
def test_output_nonimage(): with pytest.raises(OSError): sharpen("pixfixPy/test/test_img/sharpen/test_img1.png", 5, "pixfixPy/test/test_img/sharpen/sharpen.pdf")
def test_valid_intensity(): with pytest.raises(AttributeError): sharpen("pixfixPy/test/test_img/sharpen/test_img1.png", -10.5, "pixfixPy/test/test_img/sharpen/sharpen.png")
def test_input_string(): with pytest.raises(AttributeError): sharpen(888, 5, "pixfixPy/test/test_img/sharpen/sharpen.png")