def test_block_icmp(self):
        with patch.object(firewalld, '__firewall_cmd', return_value='success'):
            with patch.object(firewalld, 'get_icmp_types', return_value='echo-reply'):
                self.assertEqual(firewalld.block_icmp('zone', 'echo-reply'), 'success')

        with patch.object(firewalld, '__firewall_cmd'):
            self.assertFalse(firewalld.block_icmp('zone', 'echo-reply'))
Test ICMP block
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/firewalld_test.py/FirewalldTestCase.test_block_icmp