From 7fc40d2ed3ab378c409e6f868d75733352ed5ddf Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 20 Sep 2010 21:04:04 -0700 Subject: pytestrpc: Be more verbose. --- source4/scripting/python/samba/tests/dcerpc/testrpc.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source4/scripting') diff --git a/source4/scripting/python/samba/tests/dcerpc/testrpc.py b/source4/scripting/python/samba/tests/dcerpc/testrpc.py index d3f97d767e..d432d5abe1 100644 --- a/source4/scripting/python/samba/tests/dcerpc/testrpc.py +++ b/source4/scripting/python/samba/tests/dcerpc/testrpc.py @@ -57,7 +57,7 @@ class RpcTests(object): print "Setting %s.%s" % (typename, n) setattr(v, n, value) except Exception, e: - if issubclass(e, AttributeError) and str(e).endswith("is read-only"): + if isinstance(e, AttributeError) and str(e).endswith("is read-only"): # readonly, ignore continue else: @@ -68,7 +68,7 @@ class RpcTests(object): # and try a comparison try: if value != getattr(v, n): - print "ERROR: Comparison failed for %s.%s != %r" % (typename, n, value) + print "ERROR: Comparison failed for %s.%s: %r != %r" % (typename, n, value, getattr(v, n)) continue except Exception, e: print "ERROR: compare exception for %s.%s: %r: %s" % (typename, n, e.__class__, e) @@ -92,9 +92,11 @@ class RpcTests(object): initial_blocks = samba.talloc_total_blocks(None) self.check_type(interface, n, value) self.check_blocks(None, initial_blocks) - except: - print "ERROR: Failed to check_type %s.%s" % (iname, n) + except Exception, e: + print "ERROR: Failed to check_type %s.%s: %r: %s" % (iname, n, e.__class__, e) self.errcount += 1 + elif callable(value): + pass # Method else: print "UNKNOWN: %s=%s" % (n, value) if self.errcount - errcount != 0: -- cgit