def is_valid(self, negotiator_id: str, offer: "Outcome") -> bool: issues = self.negotiators[negotiator_id][0].ami.issues return outcome_is_valid(offer, issues)
def test_dict_outcomes(issues, valid_outcome_dict, invalid_outcome_dict): assert outcome_is_valid(valid_outcome_dict, issues) assert not outcome_is_valid(invalid_outcome_dict, issues)
def test_list_outcomes(int_issues, valid_outcome_list, invalid_outcome_list): assert outcome_is_valid(valid_outcome_list, int_issues) assert not outcome_is_valid(invalid_outcome_list, int_issues)
def is_valid(self, negotiator_id: str, offer: "Outcome") -> bool: """Is this a valid offer for that negotiation""" issues = self.negotiators[negotiator_id][0].ami.issues return outcome_is_valid(offer, issues)