Ejemplo n.º 1
0
 def test_version(self):
     '''
     Test if return server version (``apachectl -v``)
     '''
     mock = MagicMock(return_value="Server version: Apache/2.4.7")
     with patch.dict(apache.__salt__, {'cmd.run': mock}):
         self.assertEqual(apache.version(), 'Apache/2.4.7')
Ejemplo n.º 2
0
 def test_version(self):
     '''
     Test if return server version (``apachectl -v``)
     '''
     mock = MagicMock(return_value="Server version: Apache/2.4.7")
     with patch.dict(apache.__salt__, {'cmd.run': mock}):
         self.assertEqual(apache.version(), 'Apache/2.4.7')
Ejemplo n.º 3
0
 def test_version(self):
     """
     Test if return server version (``apachectl -v``)
     """
     with patch("salt.modules.apache._detect_os",
                MagicMock(return_value="apachectl")):
         mock = MagicMock(return_value="Server version: Apache/2.4.7")
         with patch.dict(apache.__salt__, {"cmd.run": mock}):
             assert apache.version() == "Apache/2.4.7"
Ejemplo n.º 4
0
 def test_version(self):
     '''
     Test if return server version (``apachectl -v``)
     '''
     with patch('salt.modules.apache._detect_os',
                MagicMock(return_value='apachectl')):
         mock = MagicMock(return_value="Server version: Apache/2.4.7")
         with patch.dict(apache.__salt__, {'cmd.run': mock}):
             assert apache.version() == 'Apache/2.4.7'