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

test_image_processor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 13
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A test_image_processor() 0 7 2
A image_processor() 0 4 1
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