def _add_calls_and_assert_success(self, rows, ns): positions = tuple(POSITION_TAGS[n] for n in ns) calls = random.sample(CALLS, 2) formats = tuple(bidding.formatCall(call) for call in calls) for row, n, position, call, format_ in zip( rows, ns, positions, calls, formats): self._call_table.addCall(position, call) item = self._call_table.item(row, n) self.assertEqual(item.text(), format_)
def testSetCalls(self): calls = random.sample(CALLS, 4) formats = tuple(bidding.formatCall(call) for call in calls) self._call_table.setCalls( dict(position=position, call=call) for (position, call) in zip(POSITION_TAGS, calls)) for col, format_ in enumerate(formats): item = self._call_table.item(0, col) self.assertEqual(item.text(), format_)
def testCallPanelHasButtonsForAllCalls(self): button_texts = {button.text() for button in self._call_panel.buttons()} for call in CALLS: format_ = bidding.formatCall(call) self.assertIn(format_, button_texts)