Example #1
0
    def setUp(self):
        self.setUpTestReactor()

        self.setup_reporter_test()
        self.reporter_test_repo = 'https://example.org/user/repo'

        # ignore config error if txrequests is not installed
        self.patch(config, '_errors', Mock())
        self.master = fakemaster.make_master(self,
                                             wantData=True,
                                             wantDb=True,
                                             wantMq=True)

        self._http = yield fakehttpclientservice.HTTPClientService.getService(
            self.master, self, _BASE_URL, debug=None, verify=None)
        self.oauthhttp = yield fakehttpclientservice.HTTPClientService.getService(
            self.master,
            self,
            _OAUTH_URL,
            auth=('key', 'secret'),
            debug=None,
            verify=None)
        self.bsp = bsp = BitbucketStatusPush(Interpolate('key'),
                                             Interpolate('secret'))
        yield bsp.setServiceParent(self.master)
        yield bsp.startService()
Example #2
0
    def setUp(self):
        self.setup_test_reactor()

        self.setup_reporter_test()
        self.reporter_test_repo = 'https://example.org/user/repo'

        self.master = fakemaster.make_master(self,
                                             wantData=True,
                                             wantDb=True,
                                             wantMq=True)

        self._http = yield fakehttpclientservice.HTTPClientService.getService(
            self.master, self, _BASE_URL, debug=None, verify=None)
        self.oauthhttp = yield fakehttpclientservice.HTTPClientService.getService(
            self.master,
            self,
            _OAUTH_URL,
            auth=('key', 'secret'),
            debug=None,
            verify=None)
        self.bsp = BitbucketStatusPush(
            Interpolate('key'),
            Interpolate('secret'),
            status_key=Interpolate(
                "%(prop:buildername)s/%(prop:buildnumber)s"),
            status_name=Interpolate(
                "%(prop:buildername)s-%(prop:buildnumber)s"),
            generators=[
                BuildStartEndStatusGenerator(
                    start_formatter=MessageFormatter(
                        subject="{{ status_detected }}"),
                    end_formatter=MessageFormatter(subject="{{ summary }}"))
            ])
        yield self.bsp.setServiceParent(self.master)
        yield self.bsp.startService()
Example #3
0
    def setUp(self):
        self.setup_test_reactor()
        self.master = fakemaster.make_master(self, wantData=True, wantDb=True,
                                             wantMq=True)

        self.bsp = BitbucketStatusPush(
            Interpolate('key'), Interpolate('secret'))
        yield self.bsp.setServiceParent(self.master)
        yield self.bsp.startService()
    def setUp(self):
        # ignore config error if txrequests is not installed
        config._errors = Mock()
        self.master = fakemaster.make_master(testcase=self,
                                             wantData=True, wantDb=True, wantMq=True)

        self.bsp = bsp = BitbucketStatusPush('key', 'secret')
        bsp.sessionFactory = Mock(return_value=Mock())
        yield bsp.setServiceParent(self.master)
        yield bsp.startService()
Example #5
0
    def setUp(self):
        # ignore config error if txrequests is not installed
        self.patch(config, '_errors', Mock())
        self.master = fakemaster.make_master(testcase=self,
                                             wantData=True,
                                             wantDb=True,
                                             wantMq=True)

        self._http = yield fakehttpclientservice.HTTPClientService.getFakeService(
            self.master, self, _BASE_URL)
        self.oauthhttp = yield fakehttpclientservice.HTTPClientService.getFakeService(
            self.master, self, _OAUTH_URL, auth=('key', 'secret'))
        self.bsp = bsp = BitbucketStatusPush('key', 'secret')
        yield bsp.setServiceParent(self.master)
        yield bsp.startService()
Example #6
0
    def setUp(self):
        self.setup_test_reactor()

        self.setup_reporter_test()
        self.reporter_test_repo = 'https://example.org/user/repo'

        self.master = fakemaster.make_master(self, wantData=True, wantDb=True,
                                             wantMq=True)

        self._http = yield fakehttpclientservice.HTTPClientService.getService(
            self.master, self,
            _BASE_URL, auth=None,
            debug=None, verify=None)
        self.oauthhttp = yield fakehttpclientservice.HTTPClientService.getService(
            self.master, self,
            _OAUTH_URL, auth=('key', 'secret'),
            debug=None, verify=None)
        self.bsp = BitbucketStatusPush(Interpolate('key'), Interpolate('secret'))
        yield self.bsp.setServiceParent(self.master)
        yield self.bsp.startService()
Example #7
0
 def test_auth_error(self):
     with self.assertRaisesConfigError(
             "Either App Passwords or OAuth can be specified, not both"):
         BitbucketStatusPush(oauth_key='abc', oauth_secret='abc1', auth=('user', 'pass'))