Exemplo n.º 1
0
def test_Just_add_Nothing():
    obj = object()
    assert Just(obj) + Nothing() == Just(obj)
Exemplo n.º 2
0
def test_Nothing_map():
    assert Nothing().map(str) == Nothing()
Exemplo n.º 3
0
def test_Nothing_unwrap():
    with pytest.raises(ValueError):
        Nothing().unwrap()
Exemplo n.º 4
0
def test_Just_not_equals_Nothing():
    assert Just(object()) != Nothing()
Exemplo n.º 5
0
def test_Nothing_not_equals_Just():
    assert Nothing() != Just(object())
Exemplo n.º 6
0
def test_Nothing_maybe():
    obj = object()
    assert Nothing().maybe() == None
Exemplo n.º 7
0
def test_Nothing_iter():
    assert list(Nothing()) == []
Exemplo n.º 8
0
def test_Nothing_fromiter():
    assert lenses.setter.fromiter(Just(1), []) == Nothing()
Exemplo n.º 9
0
def test_Nothing_add_Just():
    obj = object()
    assert Nothing() + Just(obj) == Just(obj)
Exemplo n.º 10
0
def test_Nothing_repr_invariant():
    assert repr(Nothing()) == repr(Nothing())
Exemplo n.º 11
0
def test_Nothing_add_Nothing():
    assert Nothing() + Nothing() == Nothing()
Exemplo n.º 12
0
def test_Just_fromiter():
    obj = object()
    assert lenses.setter.fromiter(Nothing(), [obj]) == Just(obj)
Exemplo n.º 13
0
def test_Nothing_is_singleton():
    assert Nothing() is Nothing()
Exemplo n.º 14
0
def test_Just_from_iter():
    obj = object()
    assert lenses.hooks.from_iter(Nothing(), [obj]) == Just(obj)
Exemplo n.º 15
0
def test_Nothing_from_iter():
    assert lenses.hooks.from_iter(Just(1), []) == Nothing()
Exemplo n.º 16
0
def test_prism_folder_failure():
    assert list(b.JustPrism().folder(Nothing())) == []
Exemplo n.º 17
0
def test_traversal_nothing_using_identity():
    assert tc.traverse(Nothing(), ident) == Identity(Nothing())