@patch.object(iptables, '_has_option', MagicMock(return_value=True))
    def test_delete(self):
        _rule = 'm state --state RELATED,ESTABLISHED -j ACCEPT'
        self.assertEqual(iptables.delete(table='filter', chain=None,
                                         position=3, rule=_rule,
                                                   family='ipv4'),
                         'Error: Only specify a position or a rule, not both')

        mock = MagicMock(return_value=True)
        with patch.dict(iptables.__salt__, {'cmd.run': mock}):
            self.assertTrue(iptables.delete(table='filter', chain='INPUT',
                                            position=3, rule='',
                                            family='ipv4'))

    # 'flush' function tests: 1
Test if it delete a rule from the specified table/chain
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/iptables_test.py/IptablesTestCase.test_delete