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>
This commit is contained in:
Martin Basti
2015-11-12 17:17:13 +01:00
parent c08d4523b2
commit b0faf30eac

View File

@@ -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(