From b0faf30eac6b75267923fac59ef0728d763d29fe Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Thu, 12 Nov 2015 17:17:13 +0100 Subject: 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 --- ipatests/test_xmlrpc/test_dns_plugin.py | 8 +++++--- 1 file 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( -- cgit