def test_directives(self): ''' Test if return list of directives ''' mock = MagicMock(return_value="Salt") with patch.dict(apache.__salt__, {'cmd.run': mock}): self.assertEqual(apache.directives(), {'Salt': ''})
def test_directives(self): ''' Test if return list of directives ''' with patch('salt.modules.apache._detect_os', MagicMock(return_value='apachectl')): mock = MagicMock(return_value="Salt") with patch.dict(apache.__salt__, {'cmd.run': mock}): self.assertEqual(apache.directives(), {'Salt': ''})
def test_directives(self): """ Test if return list of directives """ with patch("salt.modules.apache._detect_os", MagicMock(return_value="apachectl")): mock = MagicMock(return_value="Salt") with patch.dict(apache.__salt__, {"cmd.run": mock}): assert apache.directives() == {"Salt": ""}