def setUp(self):
     super(DatastoreHooksTest, self).setUp()
     testing_common.SetIsInternalUser('*****@*****.**', True)
     testing_common.SetIsInternalUser('*****@*****.**', False)
     self._AddDataToDatastore()
     datastore_hooks.InstallHooks()
     self.PatchDatastoreHooksRequest()
Beispiel #2
0
 def setUp(self):
   super(NewPointsTest, self).setUp()
   app = webapp2.WSGIApplication(
       [('/new_points', new_points.NewPointsHandler)])
   self.testapp = webtest.TestApp(app)
   self.SetCurrentUser('*****@*****.**', is_admin=True)
   testing_common.SetIsInternalUser('*****@*****.**', True)
   testing_common.SetIsInternalUser('*****@*****.**', False)
 def setUp(self):
   super(EditSiteConfigTest, self).setUp()
   app = webapp2.WSGIApplication(
       [('/edit_site_config', edit_site_config.EditSiteConfigHandler)])
   self.testapp = webtest.TestApp(app)
   testing_common.SetIsInternalUser('*****@*****.**', True)
   testing_common.SetIsInternalUser('*****@*****.**', False)
   self.SetCurrentUser('*****@*****.**', is_admin=True)
Beispiel #4
0
 def setUp(self):
     super(ListTestsTest, self).setUp()
     app = webapp2.WSGIApplication([('/list_tests',
                                     list_tests.ListTestsHandler)])
     self.testapp = webtest.TestApp(app)
     datastore_hooks.InstallHooks()
     self.UnsetCurrentUser()
     testing_common.SetIsInternalUser('*****@*****.**', True)
     testing_common.SetIsInternalUser('*****@*****.**', False)
 def setUp(self):
     super(SetWarningMessageTest, self).setUp()
     app = webapp2.WSGIApplication([
         ('/set_warning_message',
          set_warning_message.SetWarningMessageHandler)
     ])
     self.testapp = webtest.TestApp(app)
     testing_common.SetIsInternalUser('*****@*****.**', True)
     testing_common.SetIsInternalUser('*****@*****.**', False)
 def setUp(self):
   super(LayeredCacheDeleteExpiredTest, self).setUp()
   app = webapp2.WSGIApplication([(
       '/delete_expired_entities',
       layered_cache_delete_expired.LayeredCacheDeleteExpiredHandler)])
   self.testapp = webtest.TestApp(app)
   self.UnsetCurrentUser()
   testing_common.SetIsInternalUser('*****@*****.**', True)
   testing_common.SetIsInternalUser('*****@*****.**', False)
Beispiel #7
0
    def setUp(self):
        super(FileBugTest, self).setUp()
        app = webapp2.WSGIApplication([('/file_bug', file_bug.FileBugHandler)])
        self.testapp = webtest.TestApp(app)
        testing_common.SetSheriffDomains(['chromium.org'])
        testing_common.SetIsInternalUser('*****@*****.**', True)
        testing_common.SetIsInternalUser('*****@*****.**', False)
        self.SetCurrentUser('*****@*****.**')

        mits = mock.MagicMock()
        mits.IssueTrackerService = MockIssueTrackerService
        self.PatchObject(file_bug, 'issue_tracker_service', mits)
Beispiel #8
0
 def setUp(self):
     super(FileBugTest, self).setUp()
     testing_common.SetSheriffDomains(['chromium.org'])
     testing_common.SetIsInternalUser('*****@*****.**', True)
     testing_common.SetIsInternalUser('*****@*****.**', False)
     self.SetCurrentUser('*****@*****.**')
     self._issue_tracker_service = testing_common.FakeIssueTrackerService()
     self.PatchObject(file_bug.file_bug.issue_tracker_service,
                      'IssueTrackerService',
                      lambda *_: self._issue_tracker_service)
     app = webapp2.WSGIApplication([('/file_bug', file_bug.FileBugHandler)])
     self.testapp = webtest.TestApp(app)
  def setUp(self):
    super(FileBugTest, self).setUp()
    app = webapp2.WSGIApplication([('/file_bug', file_bug.FileBugHandler)])
    self.testapp = webtest.TestApp(app)
    testing_common.SetSheriffDomains(['chromium.org'])
    testing_common.SetIsInternalUser('*****@*****.**', True)
    testing_common.SetIsInternalUser('*****@*****.**', False)
    self.SetCurrentUser('*****@*****.**')

    # Add a fake issue tracker service that we can get call values from.
    file_bug.issue_tracker_service = mock.MagicMock()
    self.original_service = file_bug.issue_tracker_service.IssueTrackerService
    self.service = MockIssueTrackerService
    file_bug.issue_tracker_service.IssueTrackerService = self.service
 def setUp(self):
   super(GetDiagnosticsTest, self).setUp()
   app = webapp2.WSGIApplication([
       ('/get_diagnostics', get_diagnostics.GetDiagnosticsHandler)])
   self.testapp = webtest.TestApp(app)
   testing_common.SetIsInternalUser('*****@*****.**', True)
   self.SetCurrentUser('*****@*****.**', is_admin=True)
Beispiel #11
0
 def setUp(self):
   super(AddHistogramsTest, self).setUp()
   app = webapp2.WSGIApplication([
       ('/add_histograms', add_histograms.AddHistogramsHandler)])
   self.testapp = webtest.TestApp(app)
   testing_common.SetIsInternalUser('*****@*****.**', True)
   self.SetCurrentUser('*****@*****.**', is_admin=True)
Beispiel #12
0
    def setUp(self):
        super(GitilesTest, self).setUp()
        app = webapp2.WSGIApplication([
            webapp2.Route(r'/api/gitiles', gitiles.Gitiles),
        ])
        self.testapp = webtest.TestApp(app)

        self.SetCurrentUser('*****@*****.**')

        namespaced_stored_object.Set('repositories', {
            'src': {
                'repository_url': 'http://src'
            },
        })

        self.SetCurrentUser('*****@*****.**', is_admin=True)
        testing_common.SetIsInternalUser('*****@*****.**', True)

        namespaced_stored_object.Set(
            'repositories', {
                'src': {
                    'repository_url': 'http://src'
                },
                'internal_only': {
                    'repository_url': 'http://foo'
                },
            })
Beispiel #13
0
 def _SetupCredentials(self, user, client_id, is_internal, is_admin):
     email = user.email()
     testing_common.SetIsInternalUser(email, is_internal)
     testing_common.SetIsAdministrator(email, is_admin)
     self.SetCurrentUserOAuth(user)
     self.SetCurrentClientIdOAuth(client_id)
     self.SetCurrentUser(email)
Beispiel #14
0
 def setUp(self):
     super(AutoBisectTest, self).setUp()
     app = webapp2.WSGIApplication([('/auto_bisect',
                                     auto_bisect.AutoBisectHandler)])
     testing_common.SetIsInternalUser('*****@*****.**', True)
     self.testapp = webtest.TestApp(app)
     self.SetCurrentUser('*****@*****.**')
Beispiel #15
0
 def testPost_OAuthUser_ServiceAccount(self):
     self.SetCurrentUserOAuth(testing_common.SERVICE_ACCOUNT_USER)
     testing_common.SetIsInternalUser(testing_common.SERVICE_ACCOUNT_USER,
                                      True)
     with self.PatchEnviron('/api/fake'):
         api_auth.Authorize()
     self.assertTrue(self.mock_set_privileged_request.called)
Beispiel #16
0
 def setUp(self):
     super(AlertsTest, self).setUp()
     app = webapp2.WSGIApplication([('/alerts', alerts.AlertsHandler)])
     self.testapp = webtest.TestApp(app)
     testing_common.SetSheriffDomains(['chromium.org'])
     testing_common.SetIsInternalUser('*****@*****.**', True)
     self.SetCurrentUser('*****@*****.**', is_admin=True)
Beispiel #17
0
 def setUp(self):
     super(BisectFYITest, self).setUp()
     app = webapp2.WSGIApplication([('/bisect_fyi',
                                     bisect_fyi.BisectFYIHandler)])
     self.testapp = webtest.TestApp(app)
     stored_object.Set(bisect_fyi._BISECT_FYI_CONFIGS_KEY, TEST_FYI_CONFIGS)
     testing_common.SetIsInternalUser('*****@*****.**', True)
     self.SetCurrentUser('*****@*****.**')
Beispiel #18
0
 def setUp(self):
   super(MigrateTestNamesTest, self).setUp()
   app = webapp2.WSGIApplication([(
       '/migrate_test_names', migrate_test_names.MigrateTestNamesHandler)])
   self.testapp = webtest.TestApp(app)
   # Make sure puts get split up into multiple calls.
   migrate_test_names._MAX_DATASTORE_PUTS_PER_PUT_MULTI_CALL = 30
   self.SetCurrentUser('*****@*****.**')
   testing_common.SetIsInternalUser('*****@*****.**', True)
Beispiel #19
0
 def setUp(self):
     super(SpeedReleasingTest, self).setUp()
     app = webapp2.WSGIApplication([
         (r'/speed_releasing/(.*)', speed_releasing.SpeedReleasingHandler)
     ])
     self.testapp = webtest.TestApp(app)
     testing_common.SetSheriffDomains(['chromium.org'])
     testing_common.SetIsInternalUser('*****@*****.**', True)
     self.SetCurrentUser('*****@*****.**', is_admin=True)
Beispiel #20
0
 def setUp(self):
   super(CreateHealthReportTest, self).setUp()
   app = webapp2.WSGIApplication([(
       '/create_health_report',
       create_health_report.CreateHealthReportHandler)])
   self.testapp = webtest.TestApp(app)
   testing_common.SetSheriffDomains(['chromium.org'])
   testing_common.SetIsInternalUser('*****@*****.**', True)
   self.SetCurrentUser('*****@*****.**', is_admin=True)
Beispiel #21
0
 def setUp(self):
   super(ListTestSuitesTest, self).setUp()
   app = webapp2.WSGIApplication(
       [('/update_test_suites',
         update_test_suites.UpdateTestSuitesHandler)])
   self.testapp = webtest.TestApp(app)
   datastore_hooks.InstallHooks()
   testing_common.SetIsInternalUser('*****@*****.**', True)
   self.UnsetCurrentUser()
Beispiel #22
0
 def setUp(self):
   super(AddHistogramsQueueTestWithUploadCompletionToken, self).setUp()
   app = webapp2.WSGIApplication([
       ('/add_histograms_queue',
        add_histograms_queue.AddHistogramsQueueHandler)
   ])
   self.testapp = webtest.TestApp(app)
   testing_common.SetIsInternalUser('*****@*****.**', True)
   self.SetCurrentUser('*****@*****.**')
Beispiel #23
0
 def setUp(self):
     super(BadBisectHandlerTest, self).setUp()
     app = webapp2.WSGIApplication([('/bad_bisect',
                                     bad_bisect.BadBisectHandler)])
     self.testapp = webtest.TestApp(app)
     testing_common.SetSheriffDomains(['chromium.org'])
     testing_common.SetIsInternalUser('*****@*****.**', True)
     self.SetCurrentUser('*****@*****.**')
     try_job.TryJob(id=1234).put()
 def setUp(self):
     super(AddHistogramsTest, self).setUp()
     app = webapp2.WSGIApplication([('/add_histograms',
                                     add_histograms.AddHistogramsHandler)])
     self.testapp = webtest.TestApp(app)
     testing_common.SetIsInternalUser('*****@*****.**', True)
     self.SetCurrentUser('*****@*****.**', is_admin=True)
     oauth_patcher = mock.patch.object(api_auth, 'oauth')
     self.addCleanup(oauth_patcher.stop)
     mock_oauth = oauth_patcher.start()
     SetGooglerOAuth(mock_oauth)
Beispiel #25
0
    def setUp(self):
        super(UploadInfo, self).setUp()
        app = webapp2.WSGIApplication([('/uploads/(.*)',
                                        uploads_info.UploadInfoHandler)])
        self.testapp = webtest.TestApp(app)

        testing_common.SetIsInternalUser('*****@*****.**', True)
        self.SetCurrentUser('*****@*****.**')

        oauth_patcher = mock.patch.object(api_auth, 'oauth')
        self.addCleanup(oauth_patcher.stop)
        SetInternalUserOAuth(oauth_patcher.start())
Beispiel #26
0
  def setUp(self):
    super(ConfigTest, self).setUp()

    self.SetCurrentUser('*****@*****.**')

    namespaced_stored_object.Set('bot_configurations', {
        'chromium-rel-mac11-pro': {},
    })

    self.SetCurrentUser('*****@*****.**', is_admin=True)
    testing_common.SetIsInternalUser('*****@*****.**', True)

    namespaced_stored_object.Set('bot_configurations', {
        'internal-only-bot': {},
    })
 def setUp(self):
     super(ListTestSuitesTest, self).setUp()
     app = webapp2.WSGIApplication([
         ('/update_test_suites', update_test_suites.UpdateTestSuitesHandler)
     ])
     self.testapp = webtest.TestApp(app)
     testing_common.SetIsInternalUser('*****@*****.**', True)
     self.UnsetCurrentUser()
     stored_object.Set(descriptor.PARTIAL_TEST_SUITES_KEY, [
         'TEST_PARTIAL_TEST_SUITE',
     ])
     stored_object.Set(descriptor.GROUPABLE_TEST_SUITE_PREFIXES_KEY, [
         'TEST_GROUPABLE%',
     ])
     descriptor.Descriptor.ResetMemoizedConfigurationForTesting()
Beispiel #28
0
 def setUp(self):
     super(UpdateTestSuiteDescriptorsTest, self).setUp()
     handler = update_test_suite_descriptors.UpdateTestSuiteDescriptorsHandler
     self.SetUpApp([('/update_test_suite_descriptors', handler)])
     testing_common.SetIsInternalUser('*****@*****.**', True)
     self.UnsetCurrentUser()
     stored_object.Set(descriptor.PARTIAL_TEST_SUITES_KEY, [
         'TEST_PARTIAL_TEST_SUITE',
     ])
     stored_object.Set(descriptor.COMPOSITE_TEST_SUITES_KEY, [
         'TEST_PARTIAL_TEST_SUITE:COMPOSITE',
     ])
     stored_object.Set(descriptor.GROUPABLE_TEST_SUITE_PREFIXES_KEY, [
         'TEST_GROUPABLE%',
     ])
     descriptor.Descriptor.ResetMemoizedConfigurationForTesting()
Beispiel #29
0
  def setUp(self):
    super(ConfigTest, self).setUp()
    app = webapp2.WSGIApplication([
        webapp2.Route(r'/api/config', config.Config),
    ])
    self.testapp = webtest.TestApp(app)

    self.SetCurrentUser('*****@*****.**')

    namespaced_stored_object.Set('bot_configurations', {
        'chromium-rel-mac11-pro': {},
    })

    self.SetCurrentUser('*****@*****.**', is_admin=True)
    testing_common.SetIsInternalUser('*****@*****.**', True)

    namespaced_stored_object.Set('bot_configurations', {
        'internal-only-bot': {},
    })
Beispiel #30
0
 def setUp(self):
     super(UtilsTest, self).setUp()
     testing_common.SetIsInternalUser('*****@*****.**', True)
     testing_common.SetIsInternalUser('*****@*****.**', False)
     testing_common.SetIsAdministrator('*****@*****.**', True)