Ejemplo n.º 1
0
 def test_servermods(self):
     '''
     Test if return list of modules compiled into the server
     '''
     mock = MagicMock(return_value="core.c\nmod_so.c")
     with patch.dict(apache.__salt__, {'cmd.run': mock}):
         self.assertEqual(apache.servermods(), ['core.c', 'mod_so.c'])
Ejemplo n.º 2
0
 def test_servermods(self):
     '''
     Test if return list of modules compiled into the server
     '''
     mock = MagicMock(return_value="core.c\nmod_so.c")
     with patch.dict(apache.__salt__, {'cmd.run': mock}):
         self.assertEqual(apache.servermods(), ['core.c', 'mod_so.c'])
Ejemplo n.º 3
0
 def test_servermods(self):
     """
     Test if return list of modules compiled into the server
     """
     with patch("salt.modules.apache._detect_os",
                MagicMock(return_value="apachectl")):
         mock = MagicMock(return_value="core.c\nmod_so.c")
         with patch.dict(apache.__salt__, {"cmd.run": mock}):
             assert apache.servermods() == ["core.c", "mod_so.c"]
Ejemplo n.º 4
0
 def test_servermods(self):
     '''
     Test if return list of modules compiled into the server
     '''
     with patch('salt.modules.apache._detect_os',
                MagicMock(return_value='apachectl')):
         mock = MagicMock(return_value="core.c\nmod_so.c")
         with patch.dict(apache.__salt__, {'cmd.run': mock}):
             assert apache.servermods() == ['core.c', 'mod_so.c']