(
hasher, mocker_preprocess_image, mocker_hash_func
)
| 105 | |
| 106 | |
| 107 | def test_encode_image_accepts_numpy_array( |
| 108 | hasher, mocker_preprocess_image, mocker_hash_func |
| 109 | ): |
| 110 | ret_val = np.zeros((2, 2)) |
| 111 | hasher.encode_image(image_array=ret_val) |
| 112 | mocker_preprocess_image.assert_called_with( |
| 113 | image=ret_val, target_size=(8, 8), grayscale=True |
| 114 | ) |
| 115 | np.testing.assert_array_equal(ret_val, mocker_hash_func.call_args[0][0]) |
| 116 | |
| 117 | |
| 118 | def test_encode_image_valerror_wrong_input(hasher): |
nothing calls this directly
no test coverage detected