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)
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)