summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc/test_group_plugin.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-07-27 16:35:23 -0400
committerRob Crittenden <rcritten@redhat.com>2010-08-06 15:32:37 -0400
commit2d7d047cbf9375a4c75196f13ac1e0c439ae9e8b (patch)
treec30749ec5472dcbfb54165ec5f0c28f87377fe08 /tests/test_xmlrpc/test_group_plugin.py
parent252b73fb3ec3cfb6c5efb4b93db321eedd3745e1 (diff)
downloadfreeipa-2d7d047cbf9375a4c75196f13ac1e0c439ae9e8b.tar.gz
freeipa-2d7d047cbf9375a4c75196f13ac1e0c439ae9e8b.tar.xz
freeipa-2d7d047cbf9375a4c75196f13ac1e0c439ae9e8b.zip
Add optional error message to pattern validator
The pattern validator by default displays the pattern that is being matched against. This isn't helpful, particularly for very hairy patterns. This adds a new parameter, pattern_errmsg, that is displayed on errors if set. ticket #11
Diffstat (limited to 'tests/test_xmlrpc/test_group_plugin.py')
-rw-r--r--tests/test_xmlrpc/test_group_plugin.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_group_plugin.py b/tests/test_xmlrpc/test_group_plugin.py
index 620f3eacd..a8940a0d0 100644
--- a/tests/test_xmlrpc/test_group_plugin.py
+++ b/tests/test_xmlrpc/test_group_plugin.py
@@ -28,6 +28,9 @@ from xmlrpc_test import Declarative, fuzzy_digits, fuzzy_uuid
group1 = u'testgroup1'
group2 = u'testgroup2'
+invalidgroup1=u'+tgroup1'
+invalidgroup2=u'tgroup1234567890123456789012345678901234567890'
+
class test_group(Declarative):
cleanup_commands = [
@@ -511,4 +514,18 @@ class test_group(Declarative):
expected=errors.NotFound(reason='no such entry'),
),
+ dict(
+ desc='Test an invalid group name %r' % invalidgroup1,
+ command=('group_add', [invalidgroup1], dict(description=u'Test')),
+ expected=errors.ValidationError(name='cn', error='may only include letters, numbers, _, -, . and $'),
+ ),
+
+
+ dict(
+ desc='Test a group name that is too long %r' % invalidgroup2,
+ command=('group_add', [invalidgroup2], dict(description=u'Test')),
+ expected=errors.ValidationError(name='cn', error='can be at most 33 characters'),
+ ),
+
+
]