コード例 #1
0
    def test_import_config_set_with_auth_error(self):
        self.mock(gitiles, 'get_log', mock.Mock())
        gitiles.get_log.side_effect = net.AuthError('Denied', 500, 'Denied')

        # Should not raise an exception.
        gitiles_import.import_config_set(
            'config_set', gitiles.Location.parse('https://localhost/project'))
コード例 #2
0
  def test_import_config_set_with_auth_error(self):
    self.mock(gitiles, 'get_log', mock.Mock())
    gitiles.get_log.side_effect = net.AuthError('Denied', 500, 'Denied')

    with self.assertRaises(gitiles_import.Error):
      gitiles_import._import_config_set(
          'config_set',
          gitiles.Location.parse('https://localhost/project'))
    self.assert_attempt(
        False, 'Could not import: permission denied', no_revision=True)
コード例 #3
0
 def json_request(*args, **kwargs):
     raise net.AuthError('403', 403, '403')