Commit b09365a2 authored by Daniel Salzman's avatar Daniel Salzman

tests-extra: use getattr instead of if machinery

parent cbbb84ec
......@@ -60,18 +60,12 @@ class Response(object):
'''Checks given section for particular record/rdata'''
sect = getattr(self.resp, section)
if not rtype:
rtype = self.rtype
elif type(rtype) is str:
rtype = dns.rdatatype.from_text(rtype)
if section == "answer":
sect = self.resp.answer
elif section == "additional":
sect = self.resp.additional
elif section == "authority":
sect = self.resp.authority
# Check rdata presence.
if rdata:
# We work with just one rdata with TTL=0 (this TTL is not used).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment