示例#1
0
 def test_unknown_string(self):
     with testtools.ExpectedException(n_exc.InvalidInput):
         converters.convert_to_protocol("Invalid")
示例#2
0
 def test_numeric_is_valid(self):
     proto_num_str = str(constants.PROTO_NUM_IGMP)
     result = converters.convert_to_protocol(proto_num_str)
     self.assertEqual(proto_num_str, result)
示例#3
0
 def test_numeric_too_low(self):
     with testtools.ExpectedException(n_exc.InvalidInput):
         converters.convert_to_protocol("-1")
示例#4
0
 def test_icmp_is_valid(self):
     result = converters.convert_to_protocol(constants.PROTO_NAME_ICMP)
     self.assertEqual(constants.PROTO_NAME_ICMP, result)
     proto_num_str = str(constants.PROTO_NUM_ICMP)
     result = converters.convert_to_protocol(proto_num_str)
     self.assertEqual(proto_num_str, result)