<s> import traceback <EOL> from tests . test_helper import * <EOL> from braintree . attribute_getter import AttributeGetter <EOL> class TestHttp ( unittest . TestCase ) : <EOL> def test_raise_exception_from_status_for_upgrade_required ( self ) : <EOL> try : <EOL> Http . raise_exception_from_status ( <NUM_LIT> ) <EOL> self . assertTrue ( False ) <EOL> except UpgradeRequiredError : <EOL> pass <EOL> def test_backtrace_preserved_when_not_wrapping_exceptions ( self ) : <EOL> class Error ( Exception ) : <EOL> pass <EOL> def raise_error ( * _ ) : <EOL> raise Error <EOL> http_strategy = AttributeGetter ( { "<STR_LIT>" : raise_error } ) <EOL> config = AttributeGetter ( { <EOL> "<STR_LIT>" : ( lambda : "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( lambda : False ) , <EOL> "<STR_LIT>" : ( lambda : False ) , <EOL> "<STR_LIT>" : ( lambda : http_strategy ) , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : False } ) <EOL> try : <EOL> Http ( config , "<STR_LIT:a>" ) . _Http__http_do ( "<STR_LIT:a>" , "<STR_LIT:b>" ) <EOL> except Error as e : <EOL> _ , _ , tb = sys . exc_info ( ) <EOL> self . assertEqual ( '<STR_LIT>' , traceback . extract_tb ( tb ) [ - <NUM_LIT:1> ] [ <NUM_LIT:2> ] ) </s>
