コード例 #1
0
def test_lazylist_add_non_iterable_non_lazy_list_rases_value_error():
    with raises(ValueError):
        LazyList([1]) + None
コード例 #2
0
def test_lazylist_immutable():
    ll = LazyList([])
    with raises(TypeError):
        ll[0] = 1
コード例 #3
0
ファイル: test_lazylist.py プロジェクト: eosulliv/menpo
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
コード例 #4
0
ファイル: test_lazylist.py プロジェクト: eosulliv/menpo
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)
コード例 #5
0
 def foo_importer(filepath, **kwargs):
     return LazyList([lambda: Image.init_blank((10, 10))])