SERPent / tests /test_serp_models.py
Claude
Add pytest harness with characterization tests for scrap/ops/serp/utils
5796881 unverified
Raw
History Blame Contribute Delete
478 Bytes
import pytest
from serp import SerpQuery
@pytest.mark.parametrize(
"raw, expected",
[
(10, 10),
(1, 1),
(100, 100),
(0, 1),
(-5, 1),
(500, 100),
(101, 100),
],
)
def test_n_results_is_clamped_to_1_100(raw, expected):
q = SerpQuery(queries=["test"], n_results=raw)
assert q.n_results == expected
def test_n_results_defaults_to_10():
q = SerpQuery(queries=["test"])
assert q.n_results == 10