def test_range_int_argument(self):
     self.assertEqual(5, validation.range_int_argument('5', 5, 12))
     self.assertEqual(5, validation.range_int_argument('5', 5, 12,
                                                     exclusions=[4,7]))
     with self.assertRaises(argparse.ArgumentTypeError):
         validation.range_int_argument('x', 5, 12)
     with self.assertRaises(argparse.ArgumentTypeError):
         validation.range_int_argument('3', 7, 12)
 def test_range_int_argument(self):
     self.assertEqual(5, validation.range_int_argument('5', 5, 12))
     self.assertEqual(
         5, validation.range_int_argument('5', 5, 12, exclusions=[4, 7]))
     with self.assertRaises(argparse.ArgumentTypeError):
         validation.range_int_argument('x', 5, 12)
     with self.assertRaises(argparse.ArgumentTypeError):
         validation.range_int_argument('3', 7, 12)
def status_port(value):
    if not value:
        return ENCRYPTOR_STATUS_PORT
    return validation.range_int_argument(value, 1, 65535, exclusions=[81,])
Beispiel #4
0
def status_port(value):
    if not value:
        return ENCRYPTOR_STATUS_PORT
    return validation.range_int_argument(value, 1, 65535, exclusions=[
        81,
    ])