def test_status(self): ''' Test if it return rabbitmq status. ''' mock_run = MagicMock(return_value='saltstack') with patch.dict(rabbitmq.__salt__, {'cmd.run': mock_run}): self.assertEqual(rabbitmq.status(), 'saltstack')
def test_status(self): ''' Test if it return rabbitmq status. ''' mock_run = MagicMock(return_value={'retcode': 0, 'stdout': 'saltstack', 'stderr': ''}) with patch.dict(rabbitmq.__salt__, {'cmd.run_all': mock_run}): self.assertEqual(rabbitmq.status(), 'saltstack')
def test_status(self): """ Test if it return rabbitmq status. """ mock_run = MagicMock( return_value={"retcode": 0, "stdout": "saltstack", "stderr": ""} ) with patch.dict(rabbitmq.__salt__, {"cmd.run_all": mock_run}): self.assertEqual(rabbitmq.status(), "saltstack")