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)
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)
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)
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)