Ejemplo n.º 1
0
  def test_update_pulse_interval_too_small(self):
    mock_config = self.create_mock_config()
    self._fake_context.get_job_config = Mock(return_value=mock_config)

    error = Context.CommandError(100, 'something failed')
    self._mock_api.start_job_update.side_effect = error

    with patch('apache.aurora.client.cli.update.DiffFormatter'):
      with pytest.raises(Context.CommandError) as e:
        self._command.execute(self._fake_context)

    assert e.value == error
    assert self._mock_api.start_job_update.mock_calls == [call(ANY, None, None, ANY)]
Ejemplo n.º 2
0
 def method_wrapper(*args, **kwargs):
     try:
         return getattr(self._delegate, method_name)(*args, **kwargs)
     except SchedulerProxy.AuthError as e:
         raise Context.CommandError(EXIT_AUTH_ERROR, str(e))