コード例 #1
0
 def test_trigger_job_exception(self, mock_jenkins, _):
     mock_jenkins.side_effect = jenkins.JenkinsException()
     param = {"node": "test"}
     with self.assertRaises(jenkins.JenkinsException) as exception:
         jxcore = JxCore()
         jxcore.trigger_job("test_job", param)
     self.assertEqual(str(exception.exception), "Job not found")
コード例 #2
0
 def test_trigger_job(self, mock_jenkins, _):
     param = {"node": "test"}
     jxcore = JxCore()
     jxcore.trigger_job("test_job", param)
     mock_jenkins.assert_called_with("test_job", param)