예제 #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)