Ejemplo n.º 1
0
def test_greyscale():
    '''
    Check if the greyscale function could get the expected image
    '''
    greyscale("tests/images/sample.png", "tests/images/sample.png")
    output = skimage.io.imread("tests/images/sample.png")
    test_output = skimage.io.imread("tests/images/sample.png")
    assert np.array_equal(output, test_output), \
        "The greyscale function does not work properly"
Ejemplo n.º 2
0
def test_nonexistent_output_path():
    '''
    Check unexpected greyscale function input for output
    '''
    with pytest.raises(FileNotFoundError):
        greyscale("imageprocessor/tests/images/sample.png", "./123/456.png")
Ejemplo n.º 3
0
def test_nonexistent_input_path():
    '''
    Check unexpected greyscale function for input path
    '''
    with pytest.raises(FileNotFoundError):
        greyscale("./123/456.png", "tests/images/sample.png")
Ejemplo n.º 4
0
def test_non_string_output():
    '''
    Check unexpected rotating function for output path format
    '''
    with pytest.raises(AttributeError):
        greyscale(0, 555)
Ejemplo n.º 5
0
def test_non_string_input():
    '''
    Check unexpected greyscale function input
    '''
    with pytest.raises(AttributeError):
        greyscale(555, 0)