def test_lazylist_add_non_iterable_non_lazy_list_rases_value_error(): with raises(ValueError): LazyList([1]) + None
def test_lazylist_immutable(): ll = LazyList([]) with raises(TypeError): ll[0] = 1
def test_lazylist_get(): mock_func = Mock() mock_func.return_value = 1 ll = LazyList([mock_func] * 10) assert len(ll) == 10 assert ll[0] == 1
def test_lazylist_multi_map_unequal_lengths(): two_func = lambda: 2 double_func = [lambda x: x * 2] * 2 ll = LazyList([two_func]) with raises(ValueError): ll.map(double_func)
def foo_importer(filepath, **kwargs): return LazyList([lambda: Image.init_blank((10, 10))])