def setUp(self): if httpclientservice.txrequests is None or httpclientservice.treq is None: raise unittest.SkipTest('this test requires txrequests and treq') site = server.Site(MyResource()) self.listenport = reactor.listenTCP(0, site) self.port = self.listenport.getHost().port self.parent = parent = service.MasterService() self.parent.reactor = reactor yield parent.startService() self._http = yield self.httpFactory(parent)
def setUp(self): baseurl = 'http://127.0.0.1:8080' self.parent = service.MasterService() self._http = self.successResultOf( fakehttpclientservice.HTTPClientService.getFakeService( self.parent, self, baseurl)) self.tested = myTestedService(baseurl) self.successResultOf(self.tested.setServiceParent(self.parent)) self.successResultOf(self.parent.startService())
def setUp(self): baseurl = 'http://127.0.0.1:8080' self.parent = service.MasterService() with assertProducesWarnings(DeprecatedApiWarning, message_pattern='getFakeService'): self._http = yield fakehttpclientservice.HTTPClientService.getFakeService( self.parent, self, baseurl) self.tested = myTestedService(baseurl) yield self.tested.setServiceParent(self.parent) yield self.parent.startService()
async def setUp(self): # License note: # Copied from the original buildbot implementation with # minor changes and additions. if httpclientservice.treq is None: raise unittest.SkipTest('this test requires treq') self.parent = service.MasterService() self.parent.reactor = reactor self.headers = {} self.http = await GithubClientService.getService( self.parent, 'https://api.github.com', tokens=['A', 'B', 'C'], headers=self.headers) await self.parent.startService()