Exemple #1
0
    def test_activate(self):
        '''
        Test to activate the named worker from the lbn load balancers
         at the targeted minions.
        '''
        name = "{{ grains['id'] }}"
        lbn = 'application'
        target = 'roles:balancer'

        ret = {'name': name, 'result': False, 'comment': '', 'changes': {}}

        comt = 'no servers answered the published command modjk.worker_status'
        mock = MagicMock(return_value=False)
        with patch.dict(modjk_worker.__salt__, {'publish.publish': mock}):
            ret.update({'comment': comt})
            self.assertDictEqual(modjk_worker.activate(name, lbn, target), ret)
def test_activate():
    """
    Test to activate the named worker from the lbn load balancers
     at the targeted minions.
    """
    name = "{{ grains['id'] }}"
    lbn = "application"
    target = "roles:balancer"

    ret = {"name": name, "result": False, "comment": "", "changes": {}}

    comt = "no servers answered the published command modjk.worker_status"
    mock = MagicMock(return_value=False)
    with patch.dict(modjk_worker.__salt__, {"publish.publish": mock}):
        ret.update({"comment": comt})
        assert modjk_worker.activate(name, lbn, target) == ret
Exemple #3
0
    def test_activate(self):
        '''
        Test to activate the named worker from the lbn load balancers
         at the targeted minions.
        '''
        name = "{{ grains['id'] }}"
        lbn = 'application'
        target = 'roles:balancer'

        ret = {'name': name,
               'result': False,
               'comment': '',
               'changes': {}}

        comt = ('no servers answered the published command modjk.worker_status')
        mock = MagicMock(return_value=False)
        with patch.dict(modjk_worker.__salt__, {'publish.publish': mock}):
            ret.update({'comment': comt})
            self.assertDictEqual(modjk_worker.activate(name, lbn, target), ret)