<s> from sure import this <EOL> from unittest import TestCase <EOL> from datetime import datetime <EOL> from dateutil . tz import tzoffset <EOL> from coinbase import CoinbaseAmount , CoinbaseContact , CoinbaseTransaction <EOL> from . import account_setup <EOL> from . http_mocking import * <EOL> @ with_http_mocking <EOL> class SendUsdToBitcoinTest ( TestCase ) : <EOL> def setUp ( self ) : <EOL> mock_http ( '<STR_LIT>' , <EOL> response_body ) <EOL> def test_send_usd_to_bitcoin_address_with_key ( self ) : <EOL> account = account_setup . with_key ( ) <EOL> tx = account . send ( <EOL> to_address = '<STR_LIT>' , <EOL> amount = CoinbaseAmount ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) <EOL> this ( last_request_json ( ) ) . should . equal ( expected_request_json ) <EOL> this ( last_request_params ( ) ) . should . equal ( { <EOL> '<STR_LIT>' : [ account_setup . api_key ] , <EOL> } ) <EOL> this ( tx ) . should . equal ( expected_transaction ) <EOL> def test_send_usd_to_bitcoin_address_with_oauth ( self ) : <EOL> account = account_setup . with_oauth ( ) <EOL> tx = account . send ( <EOL> to_address = '<STR_LIT>' , <EOL> amount = CoinbaseAmount ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) <EOL> this ( last_request_json ( ) ) . should . equal ( expected_request_json ) <EOL> this ( last_request_params ( ) ) . should . equal ( { } ) <EOL> this ( tx ) . should . equal ( expected_transaction ) <EOL> expected_request_json = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT:to>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> } <EOL> response_body = """<STR_LIT>""" <EOL> expected_transaction = CoinbaseTransaction ( <EOL> id = '<STR_LIT>' , <EOL> created_at = datetime ( <NUM_LIT> , <NUM_LIT:3> , <NUM_LIT> , <NUM_LIT:15> , <NUM_LIT:1> , <NUM_LIT:11> , <EOL> tzinfo = tzoffset ( None , - <NUM_LIT> ) ) , <EOL> notes = '<STR_LIT>' , <EOL> amount = CoinbaseAmount ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> status = CoinbaseTransaction . Status . pending , <EOL> request = False , <EOL> sender = CoinbaseContact ( <EOL> id = '<STR_LIT>' , <EOL> email = '<STR_LIT>' , <EOL> name = '<STR_LIT>' , <EOL> ) , <EOL> recipient_address = '<STR_LIT>' , <EOL> recipient_type = '<STR_LIT>' , <EOL> ) </s>
