Ejemplo n.º 1
0
 def setUp(self):
   self.services = service_manager.Services(
       issue=fake.IssueService(),
       spam=fake.SpamService())
   self.res = webapp2.Response()
   self.servlet = banspammer.BanSpammerTask('req', self.res,
       services=self.services)
Ejemplo n.º 2
0
 def setUp(self):
     self.testbed = testbed.Testbed()
     self.testbed.activate()
     self.testbed.init_user_stub()
     self.testbed.init_memcache_stub()
     self.testbed.init_datastore_v3_stub()
     self.services = service_manager.Services(
         project=fake.ProjectService(),
         config=fake.ConfigService(),
         issue=fake.IssueService(),
         issue_star=fake.IssueStarService(),
         user=fake.UserService(),
         usergroup=fake.UserGroupService(),
         features=fake.FeaturesService(),
         spam=fake.SpamService())
     self.services.user.TestAddUser('*****@*****.**', 111)
     self.proj = self.services.project.TestAddProject('proj',
                                                      project_id=789)
     self.cnxn = 'fake cnxn'
     self.servlet = issuepeek.IssuePeek('req',
                                        'res',
                                        services=self.services)
     self.local_id_1, _ = self.services.issue.CreateIssue(
         self.cnxn, self.services, 789, 'summary', 'status', 111, [], [],
         [], [], 111, 'The screen is just dark when I press power on')
Ejemplo n.º 3
0
 def setUp(self):
   self.cnxn = 'fake cnxn'
   self.services = service_manager.Services(
     config=fake.ConfigService(),
     issue=fake.IssueService(),
     user=fake.UserService(),
     project=fake.ProjectService(),
     spam=fake.SpamService()
   )
   self.project = self.services.project.TestAddProject('proj', project_id=987)
   self.servlet = spam.FlagSpamForm(
       'req', 'res', services=self.services)
Ejemplo n.º 4
0
 def setUp(self):
     self.cnxn = 'fake cnxn'
     self.services = service_manager.Services(
         config=fake.ConfigService(),
         issue=fake.IssueService(),
         user=fake.UserService(),
         project=fake.ProjectService(),
         issue_star=fake.IssueStarService(),
         spam=fake.SpamService())
     self.project = self.services.project.TestAddProject('proj',
                                                         project_id=987)
     self.servlet = issuererank.IssueRerank('req', 'res', self.services)
     self.mox = mox.Mox()
Ejemplo n.º 5
0
 def setUp(self):
     self.cnxn = 'fake cnxn'
     self.services = service_manager.Services(
         config=fake.ConfigService(),
         issue=fake.IssueService(),
         user=fake.UserService(),
         project=fake.ProjectService(),
         issue_star=fake.IssueStarService(),
         spam=fake.SpamService())
     self.project = self.services.project.TestAddProject('proj',
                                                         project_id=987)
     self.config = tracker_pb2.ProjectIssueConfig()
     self.config.statuses_offer_merge.append('Duplicate')
     self.services.config.StoreConfig(self.cnxn, self.config)
Ejemplo n.º 6
0
 def setUp(self):
   self.cnxn = 'fake cnxn'
   self.mr = testing_helpers.MakeMonorailRequest()
   self.services = service_manager.Services(
       issue=fake.IssueService(),
       project=fake.ProjectService(),
       spam=fake.SpamService(),
       user=fake.UserService())
   self.servlet = banspammer.BanSpammer('req', 'res', services=self.services)
   self.testbed = testbed.Testbed()
   self.testbed.activate()
   self.testbed.init_taskqueue_stub()
   self.taskqueue_stub = self.testbed.get_stub(testbed.TASKQUEUE_SERVICE_NAME)
   self.taskqueue_stub._root_path = os.path.dirname(
       os.path.dirname(os.path.dirname( __file__ )))
Ejemplo n.º 7
0
 def setUp(self):
     self.cnxn = 'fake cnxn'
     self.services = service_manager.Services(
         config=fake.ConfigService(),
         issue=fake.IssueService(),
         user=fake.UserService(),
         project=fake.ProjectService(),
         issue_star=fake.IssueStarService(),
         spam=fake.SpamService())
     self.services.project.TestAddProject('proj', project_id=789)
     self.mr = testing_helpers.MakeMonorailRequest()
     self.mr.auth.user_id = 111
     self.mr.auth.effective_ids = {111}
     self.mr.me_user_id = 111
     self.work_env = work_env.WorkEnv(self.mr, self.services,
                                      'Testing phase')