pageparse.ai / tests /test_preprocess.py
Varun2007's picture
initial clean deployment commit with compilers
8c3e275
Raw
History Blame Contribute Delete
656 Bytes
# SPDX-FileCopyrightText: 2026 Team Centurions
# SPDX-License-Identifier: AGPL-3.0-or-later
import numpy as np
from pageparse.preprocess import preprocess
def test_preprocess_grayscale():
img = np.random.randint(0, 256, (100, 200, 3), dtype=np.uint8)
result = preprocess(img)
assert result.ndim == 2
assert result.dtype == np.uint8
def test_preprocess_already_gray():
img = np.random.randint(0, 256, (100, 200), dtype=np.uint8)
result = preprocess(img)
assert result.shape == (100, 200)
def test_preprocess_empty():
img = np.zeros((50, 50), dtype=np.uint8)
result = preprocess(img)
assert result is not None