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