Example #1
0
    def test_stop(self):
        '''
        Test to stop 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.stop(name, lbn, target), ret)
Example #2
0
def test_stop():
    """
    Test to stop 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.stop(name, lbn, target) == ret
Example #3
0
    def test_stop(self):
        '''
        Test to stop 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.stop(name, lbn, target), ret)