Example #1
0
 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']
         })
Example #2
0
 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']})
Example #3
0
 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']
             }
Example #4
0
 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"],
             }