def setUpRequest(self, args, options=True, activate=True): self.request = FakeRequest(args=args) self.request.uri = "/change_hook/poller" self.request.method = "GET" www = self.request.site.master.www self.master = master = self.request.site.master = fakemaster.make_master( testcase=self, wantData=True) master.www = www yield self.master.startService() self.changeHook = change_hook.ChangeHookResource( dialects={'poller': options}, master=master) master.change_svc = ChangeManager() yield master.change_svc.setServiceParent(master) self.changesrc = self.Subclass("example", 21) yield self.changesrc.setServiceParent(master.change_svc) self.otherpoller = self.Subclass("otherpoller", 22) yield self.otherpoller.setServiceParent(master.change_svc) anotherchangesrc = base.ChangeSource(name='notapoller') anotherchangesrc.setName(u"notapoller") yield anotherchangesrc.setServiceParent(master.change_svc) yield self.request.test_render(self.changeHook) yield util.asyncSleep(0.1)
def setUpRequest(self, args, options=True, activate=True): self.changeHook = change_hook.ChangeHookResource(dialects={'poller': options}, master=mock.Mock()) self.request = FakeRequest(args=args) self.request.uri = "/change_hook/poller" self.request.method = "GET" master = self.request.site.master master.change_svc = ChangeManager() master.change_svc.setServiceParent(master) self.changesrc = self.Subclass("example", 21) self.changesrc.setServiceParent(master.change_svc) if activate: self.changesrc.activate() self.otherpoller = self.Subclass("otherpoller", 22) self.otherpoller.setServiceParent(master.change_svc) if activate: self.otherpoller.activate() anotherchangesrc = base.ChangeSource(name='notapoller') anotherchangesrc.setName("notapoller") anotherchangesrc.setServiceParent(master.change_svc) yield self.request.test_render(self.changeHook) yield util.asyncSleep(0)
def setUpRequest(self, args, options=True): self.changeHook = change_hook.ChangeHookResource(dialects={'poller' : options}) self.request = FakeRequest(args=args) self.request.uri = "/change_hook/poller" self.request.method = "GET" master = self.request.site.buildbot_service.master master.change_svc = ChangeManager(master) self.changesrc = self.Subclass("example", None) self.changesrc.setServiceParent(master.change_svc) self.disabledChangesrc = self.Subclass("disabled", None) self.disabledChangesrc.setServiceParent(master.change_svc) anotherchangesrc = base.ChangeSource() anotherchangesrc.setName("notapoller") anotherchangesrc.setServiceParent(master.change_svc) return self.request.test_render(self.changeHook)