def test_handle_confirmation__cancel(self, mock_input, mock_cancel): mock_input.return_value = 'Q' test_ui = UI() with self.assertRaises(SystemExit): test_ui._handle_confirmation() mock_cancel.assert_called_once()
def test_handle_confirmation__restart(self, mock_input, mock_cancel): mock_input.return_value = 'R' test_ui = UI() with self.assertRaises(UserRequestedRestart): test_ui._handle_confirmation() mock_cancel.assert_not_called()
def test_handle_confirmation__ok(self, mock_input, mock_cancel): mock_input.return_value = '' test_ui = UI() test_ui._handle_confirmation() mock_cancel.assert_not_called()