Skip to content

Commit 7cf13bc

Browse files
committed
Merge pull request #19 from cardforcoin/master
Fix CoinbaseError
2 parents 522e5ea + 041cbfa commit 7cf13bc

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

coinbase/mock.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ def get_transaction(self, transaction_id):
113113
return self._transactions[transaction_id]
114114

115115
def get_user_details(self):
116-
raise NotImplementedError # todo
116+
# todo - this could be mocked better
117+
return CoinbaseUser(email='[email protected]')
117118

118119
def generate_receive_address(self, callback_url=None):
119-
raise NotImplementedError # todo
120+
# todo - this could be mocked better
121+
return '1DzkRzSUqm8jGhT8wp7E8XNMcr9J3nT3SX'
120122

121123
def create_button(self, button, account_id=None):
122124
id = random_button_id()

coinbase/models/error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
class CoinbaseError(Exception):
55

66
def __init__(self, message, errors=None):
7-
super(CoinbaseError, Exception).__init__(self, ' '.join([message] + (errors or [])))
7+
super(CoinbaseError, self).__init__(self, ' '.join([message] + (errors or [])))

coinbase/tests/test_error.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from coinbase.models import CoinbaseError
2+
3+
4+
def test_coinbase_error_instantiation():
5+
CoinbaseError("message")
6+
CoinbaseError("message", ["abc", "def"])

0 commit comments

Comments
 (0)