def test_Just_add_Nothing(): obj = object() assert Just(obj) + Nothing() == Just(obj)
def test_Nothing_map(): assert Nothing().map(str) == Nothing()
def test_Nothing_unwrap(): with pytest.raises(ValueError): Nothing().unwrap()
def test_Just_not_equals_Nothing(): assert Just(object()) != Nothing()
def test_Nothing_not_equals_Just(): assert Nothing() != Just(object())
def test_Nothing_maybe(): obj = object() assert Nothing().maybe() == None
def test_Nothing_iter(): assert list(Nothing()) == []
def test_Nothing_fromiter(): assert lenses.setter.fromiter(Just(1), []) == Nothing()
def test_Nothing_add_Just(): obj = object() assert Nothing() + Just(obj) == Just(obj)
def test_Nothing_repr_invariant(): assert repr(Nothing()) == repr(Nothing())
def test_Nothing_add_Nothing(): assert Nothing() + Nothing() == Nothing()
def test_Just_fromiter(): obj = object() assert lenses.setter.fromiter(Nothing(), [obj]) == Just(obj)
def test_Nothing_is_singleton(): assert Nothing() is Nothing()
def test_Just_from_iter(): obj = object() assert lenses.hooks.from_iter(Nothing(), [obj]) == Just(obj)
def test_Nothing_from_iter(): assert lenses.hooks.from_iter(Just(1), []) == Nothing()
def test_prism_folder_failure(): assert list(b.JustPrism().folder(Nothing())) == []
def test_traversal_nothing_using_identity(): assert tc.traverse(Nothing(), ident) == Identity(Nothing())