示例#1
0
 def test_get_current_executable(self, _poll_executor):
     _poll_executor.return_value = self.EXEC0
     baseurl = 'http://localhost:8080/computer/host0.host.com/executors/0'
     nodename = 'host0.host.com'
     single_executer = Executor(baseurl, nodename, self.J, '0')
     self.assertEquals(single_executer.get_current_executable()['number'],
                       4168)
     self.assertEquals(single_executer.get_current_executable()['url'],
                       'http://localhost:8080/job/testjob/4168/')
示例#2
0
def test_likely_stuck(jenkins, monkeypatch):
    def fake_poll_extr(cls, tree=None):  # pylint: disable=unused-argument
        return EXEC0

    monkeypatch.setattr(Executor, '_poll', fake_poll_extr)

    baseurl = 'http://localhost:8080/computer/host0.host.com/executors/0'
    nodename = 'host0.host.com'
    single_executer = Executor(baseurl, nodename, jenkins, '0')
    assert single_executer.likely_stuck() is False
示例#3
0
def test_likely_stuck(jenkins, monkeypatch):
    def fake_poll_extr(cls, tree=None):  # pylint: disable=unused-argument
        return EXEC0

    monkeypatch.setattr(Executor, '_poll', fake_poll_extr)

    baseurl = 'http://localhost:8080/computer/host0.host.com/executors/0'
    nodename = 'host0.host.com'
    single_executer = Executor(baseurl, nodename, jenkins, '0')
    assert single_executer.likely_stuck() is False
示例#4
0
def test_get_current_executable(jenkins, monkeypatch):
    def fake_poll_extr(cls, tree=None):  # pylint: disable=unused-argument
        return EXEC0

    monkeypatch.setattr(Executor, '_poll', fake_poll_extr)

    baseurl = 'http://localhost:8080/computer/host0.host.com/executors/0'
    nodename = 'host0.host.com'
    single_executer = Executor(baseurl, nodename, jenkins, '0')
    assert single_executer.get_current_executable()['number'] == 4168
    assert single_executer.get_current_executable()['url'] == \
        'http://localhost:8080/job/testjob/4168/'
示例#5
0
def test_get_current_executable(jenkins, monkeypatch):
    def fake_poll_extr(cls, tree=None):  # pylint: disable=unused-argument
        return EXEC0

    monkeypatch.setattr(Executor, '_poll', fake_poll_extr)

    baseurl = 'http://localhost:8080/computer/host0.host.com/executors/0'
    nodename = 'host0.host.com'
    single_executer = Executor(baseurl, nodename, jenkins, '0')
    assert single_executer.get_current_executable()['number'] == 4168
    assert single_executer.get_current_executable()['url'] == \
        'http://localhost:8080/job/testjob/4168/'
示例#6
0
 def test_get_current_executable(self, _poll_executor):
     _poll_executor.return_value = self.EXEC0
     baseurl = 'http://localhost:8080/computer/host0.host.com/executors/0'
     nodename = 'host0.host.com'
     single_executer = Executor(baseurl, nodename, self.J, '0')
     self.assertEquals(
         single_executer.get_current_executable()['number'],
         4168
     )
     self.assertEquals(
         single_executer.get_current_executable()['url'],
         'http://localhost:8080/job/testjob/4168/'
     )
示例#7
0
 def __iter__(self):
     for index in range(self.count):
         executor_url = '%s/executors/%s' % (self.baseurl, index)
         yield Executor(
             executor_url,
             self.nodename,
             self.jenkins,
             index
         )
示例#8
0
 def test_likely_stuck(self, _poll_executor):
     _poll_executor.return_value = self.EXEC0
     baseurl = 'http://localhost:8080/computer/host0.host.com/executors/0'
     nodename = 'host0.host.com'
     single_executer = Executor(baseurl, nodename, self.J, '0')
     self.assertEquals(single_executer.likely_stuck(), False)
示例#9
0
 def test_likely_stuck(self, _poll_executor):
     _poll_executor.return_value = self.EXEC0
     baseurl = 'http://localhost:8080/computer/host0.host.com/executors/0'
     nodename = 'host0.host.com'
     single_executer = Executor(baseurl, nodename, self.J, '0')
     self.assertEquals(single_executer.likely_stuck(), False)