示例#1
0
    def test_delete_service(self):
        '''
        Test for Delete an existing service
        '''
        with patch.object(firewalld, '__mgmt', return_value='success'):
            mock = MagicMock(return_value='A')
            with patch.object(firewalld, '__firewall_cmd', return_value='A'):
                self.assertEqual(firewalld.delete_service('name'), 'A')

        with patch.object(firewalld, '__mgmt', return_value='A'):
            self.assertEqual(firewalld.delete_service('name'), 'A')

        with patch.object(firewalld, '__mgmt', return_value='A'):
            self.assertEqual(firewalld.delete_service('name', False), 'A')
示例#2
0
    def test_delete_service(self):
        """
        Test for Delete an existing service
        """
        with patch.object(firewalld, "__mgmt", return_value="success"):
            mock = MagicMock(return_value="A")
            with patch.object(firewalld, "__firewall_cmd", return_value="A"):
                self.assertEqual(firewalld.delete_service("name"), "A")

        with patch.object(firewalld, "__mgmt", return_value="A"):
            self.assertEqual(firewalld.delete_service("name"), "A")

        with patch.object(firewalld, "__mgmt", return_value="A"):
            self.assertEqual(firewalld.delete_service("name", False), "A")
示例#3
0
    def test_delete_service(self):
        '''
        Test for Delete an existing service
        '''
        with patch.object(firewalld, '__mgmt', return_value='success'):
            mock = MagicMock(return_value='A')
            with patch.object(firewalld, '__firewall_cmd', return_value='A'):
                self.assertEqual(firewalld.delete_service('name'), 'A')

        with patch.object(firewalld, '__mgmt', return_value='A'):
            self.assertEqual(firewalld.delete_service('name'), 'A')

        with patch.object(firewalld, '__mgmt', return_value='A'):
            self.assertEqual(firewalld.delete_service('name', False), 'A')