def test_catch_client_exception(self): def naughty(param): int(param) e = None try: rpc_common.catch_client_exception([ValueError], naughty, 'a') except rpc_common.ClientException, e: pass
def test_catch_client_exception(self): def naughty(param): int(param) e = None try: rpc_common.catch_client_exception([ValueError], naughty, 'a') except rpc_common.ClientException as e: pass self.assertTrue(isinstance(e, rpc_common.ClientException)) self.assertTrue(isinstance(e._exc_info[1], ValueError))