summaryrefslogtreecommitdiff
path: root/oslo_config/tests/test_types.py
diff options
context:
space:
mode:
authorEric Brown <browne@vmware.com>2016-07-13 12:32:10 -0700
committerEric Brown <browne@vmware.com>2016-07-14 11:34:39 -0700
commit8ed5f7555dbfa8de7324add60743eff72bcdce25 (patch)
tree9fb6429c9432d7e5868c5e0b251065e75f28d7dd /oslo_config/tests/test_types.py
parent9b05dc903f85d18b49880b0027a23f3fe224b6db (diff)
downloadoslo-config-8ed5f7555dbfa8de7324add60743eff72bcdce25.tar.gz
Add max_length to URIOpt
Currently StrOpt has a max_length parameter to restrict the length of the value, but URIOpt does not. The keystone project actually has use for a max_length to restrict a URI used for the SAML2 entity ID. Reference patch: https://review.openstack.org/#/c/341514 Change-Id: I39d012b0b7ebeddf6067016487ac8258461dda30
Diffstat (limited to 'oslo_config/tests/test_types.py')
-rw-r--r--oslo_config/tests/test_types.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/oslo_config/tests/test_types.py b/oslo_config/tests/test_types.py
index 632c3d9..b1b18cb 100644
--- a/oslo_config/tests/test_types.py
+++ b/oslo_config/tests/test_types.py
@@ -649,3 +649,9 @@ class URITypeTests(TypeTestHelper, unittest.TestCase):
def test_repr(self):
self.assertEqual('URI', repr(types.URI()))
+
+ def test_max_length(self):
+ self.type_instance = types.String(max_length=30)
+ self.assertInvalid('http://www.example.com/versions')
+ self.assertConvertedValue('http://www.example.com',
+ 'http://www.example.com')