Merge "Drop unused parameter type validation method"
This commit is contained in:
@@ -341,15 +341,6 @@ description = {
|
||||
'maxLength': 255,
|
||||
}
|
||||
|
||||
# TODO(stephenfin): This is no longer used and should be removed
|
||||
tcp_udp_port = {
|
||||
'type': ['integer', 'string'],
|
||||
'pattern': '^[0-9]*$',
|
||||
'minimum': 0,
|
||||
'maximum': 65535,
|
||||
'minLength': 1,
|
||||
}
|
||||
|
||||
project_id = {
|
||||
'type': 'string',
|
||||
'pattern': '^[a-zA-Z0-9-]*$',
|
||||
|
||||
@@ -764,31 +764,6 @@ class NameOrNoneTestCase(APIValidationTestCase):
|
||||
expected_detail=detail)
|
||||
|
||||
|
||||
class TcpUdpPortTestCase(APIValidationTestCase):
|
||||
|
||||
post_schema = {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'foo': parameter_types.tcp_udp_port,
|
||||
},
|
||||
}
|
||||
|
||||
def test_validate_tcp_udp_port(self):
|
||||
self.post(body={'foo': 1024}, req=FakeRequest())
|
||||
self.post(body={'foo': '1024'}, req=FakeRequest())
|
||||
|
||||
def test_validate_tcp_udp_port_fails(self):
|
||||
detail = ("Invalid input for field/attribute foo. Value: True."
|
||||
" True is not of type 'integer', 'string'")
|
||||
self.check_validation_error(self.post, body={'foo': True},
|
||||
expected_detail=detail)
|
||||
|
||||
detail = ("Invalid input for field/attribute foo. Value: 65536."
|
||||
" 65536 is greater than the maximum of 65535")
|
||||
self.check_validation_error(self.post, body={'foo': 65536},
|
||||
expected_detail=detail)
|
||||
|
||||
|
||||
class CidrFormatTestCase(APIValidationTestCase):
|
||||
|
||||
post_schema = {
|
||||
|
||||
Reference in New Issue
Block a user