def test_config(self): ''' Test if it create VirtualHost configuration files ''' with patch('salt.utils.fopen', mock_open()): self.assertEqual(apache.config('/ports.conf', [{'Listen': '22'}]), 'Listen 22')
def test_config(self): ''' Test if it create VirtualHost configuration files ''' with patch('salt.utils.fopen', mock_open()): self.assertEqual(apache.config('/ports.conf', [{ 'Listen': '22' }]), 'Listen 22')
def test_config(self): """ Test if it create VirtualHost configuration files """ with patch( "salt.modules.apache._parse_config", MagicMock(return_value="Listen 22") ): with patch("salt.utils.files.fopen", mock_open()): assert apache.config("/ports.conf", [{"Listen": "22"}]) == "Listen 22"
def test_config(self): ''' Test if it create VirtualHost configuration files ''' with patch('salt.modules.apache._parse_config', MagicMock(return_value='Listen 22')): with patch('salt.utils.files.fopen', mock_open()): assert apache.config('/ports.conf', [{ 'Listen': '22' }]) == 'Listen 22'