From 4a6410df54fdbc8fb08b104c47010db507443def Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 24 Oct 2011 17:37:24 +1100 Subject: s4-dnsserver: Check the raised exception with assertRaises Signed-off-by: Andrew Tridgell --- .../python/samba/tests/dcerpc/dnsserver.py | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'source4/scripting') diff --git a/source4/scripting/python/samba/tests/dcerpc/dnsserver.py b/source4/scripting/python/samba/tests/dcerpc/dnsserver.py index d185efb5b0..33c5cf7d5e 100644 --- a/source4/scripting/python/samba/tests/dcerpc/dnsserver.py +++ b/source4/scripting/python/samba/tests/dcerpc/dnsserver.py @@ -166,16 +166,14 @@ class DnsserverTests(RpcInterfaceTestCase): None, del_rec_buf) - try: - buflen, result = self.conn.DnssrvEnumRecords2(client_version, - 0, - self.server, - self.zone, - name, - None, - record_type, - select_flags, - None, - None) - except RuntimeError, e: - self.assertEquals("(9714, 'WERR_DNS_ERROR_NAME_DOES_NOT_EXIST')", str(e)) + self.assertRaises(RuntimeError, self.conn.DnssrvEnumRecords2, + client_version, + 0, + self.server, + self.zone, + name, + None, + record_type, + select_flags, + None, + None) -- cgit