def test_new_service(self):
        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.new_service('zone'), 'A')

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

        with patch.object(firewalld, '__mgmt', return_value='A'):
            self.assertEqual(firewalld.new_service('zone', False), 'A')
Test for Add a new service
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/firewalld_test.py/FirewalldTestCase.test_new_service