dump-things-service/dump_things_service/tests/test_lazylist.py
Christian Monch ba4a8d952c
Some checks failed
Codespell / Check for spelling errors (push) Successful in 25s
Ruff / Code linting (push) Failing after 28s
Test execution / Test-all (push) Successful in 1m2s
chore: reformat according to hatch check fmt
2026-11-13 15:13:36 +01:00

22 lines
500 B
Python

from typing import Any
import hypothesis.strategies as st
from hypothesis import given, reproduce_failure
from dump_things_service.lazy_list import LazyList
class DirectList(LazyList):
"""Return the plain info element."""
def generate_element(self, index, info) -> Any:
return info
@given(
data=st.lists(st.integers(), max_size=20),
s=st.slices(size=20),
)
def test_custom_list_slicing(data, s):
custom = DirectList().add_info(data)
assert custom[s] == data[s]