예제 #1
0
 def testGeneratePortNotImplemented(self):
     term = iptables.Term(FakeTerm(), 'test', True, 'test')
     # Both source and dest are false
     self.assertRaises(NotImplementedError,
                       term._GeneratePortStatement, [(1, 1), (2, 2)],
                       source=False,
                       dest=False)
예제 #2
0
 def testGeneratePortBadArguments(self):
     term = iptables.Term(FakeTerm(), 'test', True, 'test')
     # Both source and dest are true
     self.assertRaises(iptables.BadPortsError,
                       term._GeneratePortStatement, [(1, 1), (2, 2)],
                       source=True,
                       dest=True)