def test_disable(self): ''' Test to disable 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.disable(name, lbn, target), ret)
def test_disable(): """ Test to disable 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.disable(name, lbn, target) == ret
def test_disable(self): ''' Test to disable 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.disable(name, lbn, target), ret)