summaryrefslogtreecommitdiffstats
path: root/ipatests/test_xmlrpc/test_dns_plugin.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-11-12 17:17:13 +0100
committerMartin Basti <mbasti@redhat.com>2015-11-13 14:01:46 +0100
commitb0faf30eac6b75267923fac59ef0728d763d29fe (patch)
tree8b77fae2e1fe4a7b86e67f39a688297e514924b3 /ipatests/test_xmlrpc/test_dns_plugin.py
parentc08d4523b206c1a86ec4d4c577605d57611198a0 (diff)
downloadfreeipa-b0faf30eac6b75267923fac59ef0728d763d29fe.tar.gz
freeipa-b0faf30eac6b75267923fac59ef0728d763d29fe.tar.xz
freeipa-b0faf30eac6b75267923fac59ef0728d763d29fe.zip
Tests: DNS various exceptions can be raised in test
Test 'Try to add SRV record to zone %r both via parts and a raw value' can raise various exceptions which are all valid. Due to internal representation IPA may raise exception for any of target, port, priority, weight part. This commit handles all of them. Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'ipatests/test_xmlrpc/test_dns_plugin.py')
-rw-r--r--ipatests/test_xmlrpc/test_dns_plugin.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py
index 3de44e472..5f692528e 100644
--- a/ipatests/test_xmlrpc/test_dns_plugin.py
+++ b/ipatests/test_xmlrpc/test_dns_plugin.py
@@ -1148,9 +1148,11 @@ class test_dns(Declarative):
'srv_part_target' : u'foo.bar.',
'srvrecord': [u"1 100 1234 %s" \
% zone1_ns]}),
- expected=errors.ValidationError(name='srv_target',
- error=u'Raw value of a DNS record was already set by ' +
- u'"srv_rec" option'),
+ expected=lambda x, output: (
+ type(x) == errors.ValidationError and
+ x.message.endswith(u'Raw value of a DNS record was already '
+ u'set by "srv_rec" option'),
+ ),
),
dict(