def test_run_flow_no_webserver_exchange_error(self, input_mock, logging_mock): input_mock.return_value = 'auth_code' self.flow.step2_exchange.side_effect = client.FlowExchangeError() # Error while exchanging. with self.assertRaises(SystemExit): tools.run_flow(self.flow, self.storage, flags=self.flags) self.flow.step2_exchange.assert_called_once_with('auth_code', http=None)
def local_throws(code): raise client.FlowExchangeError('test')
def step2_exchange(self, auth_code): raise GoogleClient.FlowExchangeError("mock error")