Passed
Pull Request — master (#1)
by Konstantinos
59s
created

test_image_processor.image_processor()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nop 0
1
import pytest
2
import numpy as np
3
4
5
@pytest.fixture
6
def image_processor():
7
    from artificial_artwork.image.image_processor import ImageProcessor
8
    return ImageProcessor()
9
10
11
@pytest.mark.parametrize('image, pipeline, output', [
12
    ([[1,2,3], [4,5,6]], [], [[1,2,3], [4,5,6]]),
13
    ([[1,2,3], [4,5,6]], [lambda array: array + 1], [[2,3,4], [5,6,7]]),
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable array does not seem to be defined.
Loading history...
14
])
15
def test_image_processor(image, pipeline, output, image_processor):
16
    runtime_output = image_processor.process(np.array(image), pipeline)
17
    assert (runtime_output - np.array(output) == 0).all()
18