def test_min_operator_non_probability_outcome(self): probability_outcome = ProbabilityOutcome( value=1234567890, constraint_set=self._constraint_sets[1]) for name, value in self._non_probability_outcome.items(): with self.subTest(name): with self.assertRaises(TypeError): _ = probability_outcome.min_operator(value)
def test_min_operator(self): probability_outcome_one = ProbabilityOutcome( value=1234567890, constraint_set=self._constraint_sets[0]) probability_outcome_two = ProbabilityOutcome( value=987654321, constraint_set=self._constraint_sets[1]) new_probability_outcome = probability_outcome_one.min_operator( probability_outcome_two) self.assertEqual(min(1234567890, 987654321), new_probability_outcome.value) self.assertEqual(str(self._constraint_sets[-1]), str(new_probability_outcome.constraint_set))
def test_min_operator(self, value_one: int, value_two: int): probability_outcome_one = ProbabilityOutcome( value=value_one, constraint_set=self._constraint_sets[0]) probability_outcome_two = ProbabilityOutcome( value=value_two, constraint_set=self._constraint_sets[1]) new_probability_outcome = probability_outcome_one.min_operator( probability_outcome_two) self.assertEqual(min(value_one, value_two), new_probability_outcome.value) self.assertEqual(str(self._constraint_sets[-1]), str(new_probability_outcome.constraint_set))