def test_modules(self): ''' Test if return list of static and shared modules ''' mock = MagicMock(return_value="unixd_module (static)\n \ access_compat_module (shared)") with patch.dict(apache.__salt__, {'cmd.run': mock}): self.assertEqual(apache.modules(), { 'shared': ['access_compat_module'], 'static': ['unixd_module'] })
def test_modules(self): ''' Test if return list of static and shared modules ''' mock = MagicMock(return_value= "unixd_module (static)\n \ access_compat_module (shared)") with patch.dict(apache.__salt__, {'cmd.run': mock}): self.assertEqual(apache.modules(), {'shared': ['access_compat_module'], 'static': ['unixd_module']})
def test_modules(self): ''' Test if return list of static and shared modules ''' with patch('salt.modules.apache._detect_os', MagicMock(return_value='apachectl')): mock = MagicMock(return_value="unixd_module (static)\n \ access_compat_module (shared)") with patch.dict(apache.__salt__, {'cmd.run': mock}): assert apache.modules() == { 'shared': ['access_compat_module'], 'static': ['unixd_module'] }
def test_modules(self): """ Test if return list of static and shared modules """ with patch("salt.modules.apache._detect_os", MagicMock(return_value="apachectl")): mock = MagicMock(return_value=( "unixd_module (static)\n " " access_compat_module (shared)")) with patch.dict(apache.__salt__, {"cmd.run": mock}): assert apache.modules() == { "shared": ["access_compat_module"], "static": ["unixd_module"], }