From 8fac99634f3be38951dd2ad32ea76f2b0d0ec1b5 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: May 03 2012 14:55:05 +0000 Subject: Update hostname validator error messages in tests A recent patch changed the error message from the hostname validator. Update the tests to reflect this change. --- diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py index 786c496..8aeaede 100644 --- a/tests/test_xmlrpc/test_dns_plugin.py +++ b/tests/test_xmlrpc/test_dns_plugin.py @@ -114,7 +114,7 @@ class test_dns(Declarative): ), expected=errors.ValidationError(name='name', error=u'only letters, numbers, and - are allowed. ' + - u'- must not be the DNS label character'), + u'DNS label may not start or end with -'), ), @@ -478,7 +478,7 @@ class test_dns(Declarative): command=('dnsrecord_add', [dnszone1, u'invalid record'], {'arecord': u'127.0.0.1'}), expected=errors.ValidationError(name='name', error=u'only letters, numbers, _, and - are allowed. ' + - u'- must not be the DNS label character'), + u'DNS label may not start or end with -'), ), @@ -639,7 +639,7 @@ class test_dns(Declarative): 'srv_part_target' : u'foo bar'}), expected=errors.ValidationError(name='srv_target', error=u'invalid domain-name: only letters, numbers, and - ' + - u'are allowed. - must not be the DNS label character'), + u'are allowed. DNS label may not start or end with -'), ), dict( @@ -734,7 +734,7 @@ class test_dns(Declarative): command=('dnsrecord_add', [dnszone1, dnsres1], {'cnamerecord': u'-.example.com' }), expected=errors.ValidationError(name='hostname', error=u'invalid domain-name: only letters, numbers, and - ' + - u'are allowed. - must not be the DNS label character'), + u'are allowed. DNS label may not start or end with -'), ), dict( @@ -908,7 +908,7 @@ class test_dns(Declarative): command=('dnsrecord_add', [revdnszone1, dnsrev1], {'ptrrecord': u'-.example.com' }), expected=errors.ValidationError(name='hostname', error=u'invalid domain-name: only letters, numbers, and - ' + - u'are allowed. - must not be the DNS label character'), + u'are allowed. DNS label may not start or end with -'), ), dict( diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py index b7b3567..8798168 100644 --- a/tests/test_xmlrpc/test_host_plugin.py +++ b/tests/test_xmlrpc/test_host_plugin.py @@ -698,7 +698,7 @@ class test_host(Declarative): command=('host_add', [invalidfqdn1], {}), expected=errors.ValidationError(name='hostname', error=u'invalid domain-name: only letters, numbers, and - ' + - u'are allowed. - must not be the DNS label character'), + u'are allowed. DNS label may not start or end with -'), ), diff --git a/tests/test_xmlrpc/test_netgroup_plugin.py b/tests/test_xmlrpc/test_netgroup_plugin.py index afb2ac7..40ad1ea 100644 --- a/tests/test_xmlrpc/test_netgroup_plugin.py +++ b/tests/test_xmlrpc/test_netgroup_plugin.py @@ -363,7 +363,8 @@ class test_netgroup(Declarative): desc='Add invalid host %r to netgroup %r' % (invalidhost, netgroup1), command=('netgroup_add_member', [netgroup1], dict(host=invalidhost)), expected=errors.ValidationError(name='host', - error='only letters, numbers, _, and - are allowed. - must not be the DNS label character'), + error='only letters, numbers, _, and - are allowed. ' + + u'DNS label may not start or end with -'), ),