def test_unhold(self): ''' Test for put message(s) on hold from the mail queue ''' with patch.object(postfix, 'show_queue', return_value={}): self.assertDictEqual(postfix.unhold('queue_id'), {'result': False, 'message': 'No message in queue with ID queue_id'}) with patch.dict(postfix.__salt__, {'cmd.run_all': MagicMock(return_value={'retcode': 0})}): self.assertDictEqual(postfix.unhold('ALL'), {'result': True, 'message': 'Successfully set all message as unheld'})
def test_unhold(): """ Test for put message(s) on hold from the mail queue """ with patch.object(postfix, "show_queue", return_value={}): assert postfix.unhold("queue_id") == { "result": False, "message": "No message in queue with ID queue_id", } with patch.dict(postfix.__salt__, {"cmd.run_all": MagicMock(return_value={"retcode": 0})}): assert postfix.unhold("ALL") == { "result": True, "message": "Successfully set all message as unheld", }
def test_unhold(self): ''' Test for put message(s) on hold from the mail queue ''' with patch.object(postfix, 'show_queue', return_value={}): self.assertDictEqual( postfix.unhold('queue_id'), { 'result': False, 'message': 'No message in queue with ID queue_id' }) with patch.dict( postfix.__salt__, {'cmd.run_all': MagicMock(return_value={'retcode': 0})}): self.assertDictEqual( postfix.unhold('ALL'), { 'result': True, 'message': 'Successfully set all message as unheld' })