Skip to content

Commit a58c2a0

Browse files
author
ldx
committed
Add test for autocommit fix.
1 parent 4576bdf commit a58c2a0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

iptc/test/test_iptc.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@ def test_table6(self):
4545
if mangle and raw:
4646
self.assertNotEquals(id(mangle), id(raw))
4747

48+
def test_table6_autocommit(self):
49+
table = iptc.Table(iptc.Table.FILTER, False)
50+
self.assertEquals(table.autocommit, False)
51+
52+
rule = iptc.Rule()
53+
rule.src = "1.2.3.4"
54+
rule.dst = "2.3.4.5"
55+
rule.protocol = "tcp"
56+
self.assertEquals(table.autocommit, False)
57+
58+
rule.create_target('DROP')
59+
self.assertEquals(table.autocommit, False)
60+
61+
match = rule.create_match('tcp')
62+
match.dport = "80:90"
63+
self.assertEquals(table.autocommit, False)
64+
4865

4966
class TestTable(unittest.TestCase):
5067
def setUp(self):

0 commit comments

Comments
 (0)