| Total Complexity | 3 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 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]]), |
||
|
|
|||
| 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 |