def test_figures_out_own_best_hand(self): mock_hand = MagicMock() mock_hand.best_rank.return_value = "Straight Flush" player = Player(name="Boris", hand=mock_hand) self.assertEqual(player.best_hand(), "Straight Flush") mock_hand.best_rank.assert_called()
def test_figures_out_own_best_hand(self): mock_hand = MagicMock() mock_hand.best_rank.return_value = "Straight Flush" player = Player(name="Boris", hand=mock_hand) self.assertEqual(player.best_hand(), "Straight Flush") # No need to have it becuase line 16 has this check # within it. Just keep this line explicitly mock_hand.best_rank.assert_called()
def test_works_out_best_hand(self): hand = Hand() player = Player(name="Sarah", hand=hand, controller=MagicMock()) player.best_hand() self.assertEqual(player.best_hand(), hand.hand)
def test_player_has_a_best_hand(self): hand_mock = MagicMock() player = Player(name = "shoreya", hand = hand_mock) player.best_hand() hand_mock.best_rank.assert_called()