balanced/balanced-python — pull request #100 by remear (2014-02-24 22:20:00+00:00)
Title: Account and Transfer

Add Account and Transfer resources to 1.1dev.

Currently has tests failing:

```
nosetests  15:05:01
................It takes a while before the dispute record created, take and nap and wake up, then it should be done :/ (last time I tried it took 10 minutes...)
Polling disputes..., elapsed 10.1569669247
...E............EE.E.E..
======================================================================
ERROR: test_external_accounts (tests.test_suite.BasicUseCases)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ben/Development/python/balanced-python/tests/test_suite.py", line 526, in test_external_accounts
provider='name_of_provider',
File "/Users/ben/Development/python/balanced-python/balanced/resources.py", line 169, in save
resp = method(href, data=attrs)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 454, in post
return self._op(self.interface.post, uri, data=data, **kwargs)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 512, in _op
handle_error(ex)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 489, in handle_error
raise ex
HTTPError: 405 Client Error: METHOD NOT ALLOWED
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "POST /external_accounts HTTP/1.1" 405 314
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_associate_bank_account (tests.test_suite.Rev0URIBasicUseCases)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ben/Development/python/balanced-python/tests/test_suite.py", line 633, in test_associate_bank_account
bank_account.save()
File "/Users/ben/Development/python/balanced-python/balanced/resources.py", line 169, in save
resp = method(href, data=attrs)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 460, in put
return self._op(self.interface.put, uri, data=data, **kwargs)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 512, in _op
handle_error(ex)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 489, in handle_error
raise ex
HTTPError: 400 Client Error: BAD REQUEST
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "POST /api_keys HTTP/1.1" 201 288
requests.packages.urllib3.connectionpool: DEBUG: "POST /marketplaces HTTP/1.1" 201 1153
requests.packages.urllib3.connectionpool: DEBUG: "POST /customers HTTP/1.1" 201 1790
requests.packages.urllib3.connectionpool: DEBUG: "POST /bank_accounts HTTP/1.1" 201 1279
requests.packages.urllib3.connectionpool: DEBUG: "PUT /bank_accounts/BAwysCDFPaOVALZJcR5ZysU HTTP/1.1" 200 1300
requests.packages.urllib3.connectionpool: DEBUG: "POST /bank_accounts HTTP/1.1" 201 1279
requests.packages.urllib3.connectionpool: DEBUG: "PUT /bank_accounts/BAxISCvdTLprIwNOV3Yy0DC HTTP/1.1" 400 666
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_associate_card (tests.test_suite.Rev0URIBasicUseCases)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ben/Development/python/balanced-python/tests/test_suite.py", line 619, in test_associate_card
card.save()
File "/Users/ben/Development/python/balanced-python/balanced/resources.py", line 169, in save
resp = method(href, data=attrs)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 460, in put
return self._op(self.interface.put, uri, data=data, **kwargs)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 512, in _op
handle_error(ex)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 489, in handle_error
raise ex
HTTPError: 400 Client Error: BAD REQUEST
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "POST /customers HTTP/1.1" 201 1790
requests.packages.urllib3.connectionpool: DEBUG: "POST /cards HTTP/1.1" 201 1135
requests.packages.urllib3.connectionpool: DEBUG: "PUT /cards/CCzujuqpbdcYjscNssvdBkQ HTTP/1.1" 200 1156
requests.packages.urllib3.connectionpool: DEBUG: "POST /cards HTTP/1.1" 201 1135
requests.packages.urllib3.connectionpool: DEBUG: "PUT /cards/CCAQYvXHyGKwPVM9HE4W7IO HTTP/1.1" 400 666
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_customer (tests.test_suite.Rev0URIBasicUseCases)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ben/Development/python/balanced-python/tests/test_suite.py", line 606, in test_customer
result_customer = balanced.Customer.fetch(uri)
File "/Users/ben/Development/python/balanced-python/balanced/resources.py", line 211, in fetch
return cls.get(href)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 1365, in get
resp = cls.client.get(uri)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 448, in get
return self._op(self.interface.get, uri, **kwargs)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 512, in _op
handle_error(ex)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 489, in handle_error
raise ex
HTTPError: 404 Client Error: NOT FOUND
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "POST /customers HTTP/1.1" 201 1790
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1/customers/CUKFfPqC8snnjqTnGpzOTOK HTTP/1.1" 404 430
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_marketplace (tests.test_suite.Rev0URIBasicUseCases)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ben/Development/python/balanced-python/tests/test_suite.py", line 596, in test_marketplace
marketplace = balanced.Marketplace.fetch(uri)
File "/Users/ben/Development/python/balanced-python/balanced/resources.py", line 211, in fetch
return cls.get(href)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 1365, in get
resp = cls.client.get(uri)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 448, in get
return self._op(self.interface.get, uri, **kwargs)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 512, in _op
handle_error(ex)
File "/Users/ben/.virtualenvs/balanced-python/lib/python2.7/site-packages/wac.py", line 489, in handle_error
raise ex
HTTPError: 404 Client Error: NOT FOUND
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1/marketplaces/TEST-MPupSCmqkvwe9XuUBlNIeCk HTTP/1.1" 404 430
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 40 tests in 160.061s

FAILED (errors=5)
```