예제 #1
0
    def test__enable_job__HttpRequestNotOk_ReturnFalse(self):

        self.http.request('job/some job/enable', postData='').AndReturn(('whatever', HttpStatus.NOT_FOUND))
        self.mocks.ReplayAll()

        jenkins = Jenkins(self.http, self.json)
        result = jenkins.enable_job('some job')

        self.assertEqual(False, result)
예제 #2
0
    def test__enable_job__HttpRequestOk_ReturnTrue(self):

        self.http.request("job/other job/enable", postData="").AndReturn(("whatever", HttpStatus.OK))
        self.mocks.ReplayAll()

        jenkins = Jenkins(self.http, self.json)
        result = jenkins.enable_job("other job")

        self.assertEqual(True, result)
예제 #3
0
    def test__enable_job__HttpRequestOk_ReturnTrue(self):

        self.http.request('job/other job/enable', postData='').AndReturn(('whatever', HttpStatus.OK))
        self.mocks.ReplayAll()

        jenkins = Jenkins(self.http, self.json)
        result = jenkins.enable_job('other job')

        self.assertEqual(True, result)
예제 #4
0
    def test__enable_job__HttpRequestNotOk_ReturnFalse(self):

        self.http.request("job/some job/enable", postData="").AndReturn(("whatever", HttpStatus.NOT_FOUND))
        self.mocks.ReplayAll()

        jenkins = Jenkins(self.http, self.json)
        result = jenkins.enable_job("some job")

        self.assertEqual(False, result)