MCPcopy
hub / github.com/idealo/imagededup / test_encode_image_accepts_numpy_array

Function test_encode_image_accepts_numpy_array

tests/test_hashing.py:107–115  ·  view source on GitHub ↗
(
    hasher, mocker_preprocess_image, mocker_hash_func
)

Source from the content-addressed store, hash-verified

105
106
107def 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
118def test_encode_image_valerror_wrong_input(hasher):

Callers

nothing calls this directly

Calls 1

encode_imageMethod · 0.45

Tested by

no test coverage detected