Example #1
0
 def test_tester_job_name(self, not_jenkins_env):
     jcqo = JenkinsChangeQueueObject()
     out = jcqo.tester_job_name('QQQ')
     assert out == 'QQQ_change-queue-tester'
     with pytest.raises(NotInJenkins):
         out = jcqo.tester_job_name()
     jcqo.get_queue_name = MagicMock(side_effect=('QNQN',))
     out = jcqo.tester_job_name()
     assert out == 'QNQN_change-queue-tester'
Example #2
0
 def test_get_queue_name(self, not_jenkins_env):
     jcqo = JenkinsChangeQueueObject()
     jcqo.verify_in_jenkins = MagicMock()
     jcqo.get_job_name = MagicMock(side_effect=(sentinel.job_name,))
     jcqo.job_to_queue_name = MagicMock(side_effect=(sentinel.queue_name,))
     out = jcqo.get_queue_name()
     assert jcqo.verify_in_jenkins.called
     assert jcqo.get_job_name.called
     assert jcqo.job_to_queue_name.called
     assert jcqo.job_to_queue_name.call_args == call(sentinel.job_name)
     assert out == sentinel.queue_name
Example #3
0
 def test_job_to_queue_name(self, job_name, exp_queue_name):
     out_queue_name = JenkinsChangeQueueObject.job_to_queue_name(job_name)
     assert exp_queue_name == out_queue_name