コード例 #1
0
 def test_repr_contains_bound_parameter(self):
     assert_predicate_name_equals(
         boolean.one_of([boolean.true, boolean.false]),
         "one_of(true, false)")
コード例 #2
0
 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
コード例 #3
0
 def test_returns_false_for_only_failing_predicate(
         self, predicates: Iterable[Predicate]) -> None:
     assert boolean.one_of(predicates)(0) is False
コード例 #4
0
 def test_returns_true_for_one_succeeding_predicate(
         self, predicates: Iterable[Predicate]) -> None:
     assert boolean.one_of(predicates)(0) is True
コード例 #5
0
 def test_returns_false_for_more_than_one_succeeding_predicates(
         self, predicates: Iterable[Predicate]) -> None:
     assert boolean.one_of(predicates)(0) is False
コード例 #6
0
 def test_returns_false_for_empty_set_of_predicates(self) -> None:
     predicate: Predicate[int] = boolean.one_of(())
     assert predicate(0) is False