def from_expectation_tuple_in_group(cls, expectation, test_group): hand_string = expectation[0] assert '.' in hand_string, "_split_expectation expectes C.D.H.S formatted hands, missing '.': %s" % hand_string expected_call = Call.from_string(expectation[1]) history_string = expectation[2] if len(expectation) > 2 else "" vulnerability_string = expectation[3] if len(expectation) > 3 else None hand = Hand.from_cdhs_string(hand_string) call_history = CallHistory.from_string(history_string, vulnerability_string=vulnerability_string) return cls(test_group, hand, call_history, expected_call)
def _glob_helper(self, history, call_name): call = Call.from_string(call_name) # call_name can be empty if the original string is emtpy or there is trailing whitespace. if call and history.is_legal_call(call): yield call
def _assert_is_legal_call(self, history_string, bid, is_legal=True): call_history = CallHistory.from_string(history_string) bid = Call.from_string(bid) self.assertEquals(call_history.is_legal_call(bid), is_legal)
def _assert_is_legal_call(self, history_string, call_name, is_legal=True): call_history = CallHistory.from_string(history_string) call = Call.from_string(call_name) self.assertEquals(call_history.is_legal_call(call), is_legal)