22 lines
500 B
Python
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]
|