def test_repr_contains_bound_parameter(self): assert_predicate_name_equals( boolean.one_of([boolean.true, boolean.false]), "one_of(true, false)")
def test_materializes_generated_predicates( self, predicates: Iterable[Predicate]) -> None: predicate = boolean.one_of(predicate for predicate in predicates) assert predicate(0) is True assert predicate(0) is True
def test_returns_false_for_only_failing_predicate( self, predicates: Iterable[Predicate]) -> None: assert boolean.one_of(predicates)(0) is False
def test_returns_true_for_one_succeeding_predicate( self, predicates: Iterable[Predicate]) -> None: assert boolean.one_of(predicates)(0) is True
def test_returns_false_for_more_than_one_succeeding_predicates( self, predicates: Iterable[Predicate]) -> None: assert boolean.one_of(predicates)(0) is False
def test_returns_false_for_empty_set_of_predicates(self) -> None: predicate: Predicate[int] = boolean.one_of(()) assert predicate(0) is False