#NEWLINE# def httprettified( test ) : #NEWLINE# #INDENT# 'A decorator tests that use HTTPretty' #NEWLINE# def decorate_class( klass ) : #NEWLINE# #INDENT# for attr in dir ( klass ) : #NEWLINE# #INDENT# if ( not attr . startswith ( 'test_' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# attr_value = getattr ( klass , attr ) #NEWLINE# if ( not hasattr ( attr_value , '__call__' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# setattr ( klass , attr , decorate_callable ( attr_value ) ) #NEWLINE# #UNINDENT# return klass #NEWLINE# #UNINDENT# def decorate_callable( test ) : #NEWLINE# #INDENT# @ functools . wraps ( test ) #NEWLINE# def wrapper( * args , **kw ) : #NEWLINE# #INDENT# with httprettized ( ) : #NEWLINE# #INDENT# return test ( * args , ** kw ) #NEWLINE# #UNINDENT# #UNINDENT# return wrapper #NEWLINE# #UNINDENT# if isinstance ( test , ClassTypes ) : #NEWLINE# #INDENT# return decorate_class ( decorate_class ) #NEWLINE# #UNINDENT# return decorate_callable ( test )