Skip to content

Commit

Permalink
Merge pull request #463 from stripe/tomer-remove-disabled-bitcoin-end…
Browse files Browse the repository at this point in the history
…points

Remove unsupported bitcoin endpoint actions
  • Loading branch information
brandur-stripe authored Aug 16, 2018
2 parents dc87dec + 665ed60 commit d715011
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 65 deletions.
6 changes: 1 addition & 5 deletions stripe/api_resources/bitcoin_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

from stripe import util
from stripe.api_resources.customer import Customer
from stripe.api_resources.abstract import CreateableAPIResource
from stripe.api_resources.abstract import DeletableAPIResource
from stripe.api_resources.abstract import UpdateableAPIResource
from stripe.api_resources.abstract import ListableAPIResource
from stripe.six.moves.urllib.parse import quote_plus


class BitcoinReceiver(CreateableAPIResource, UpdateableAPIResource,
DeletableAPIResource, ListableAPIResource):
class BitcoinReceiver(ListableAPIResource):
OBJECT_NAME = 'bitcoin_receiver'

def instance_url(self):
Expand Down
60 changes: 0 additions & 60 deletions tests/api_resources/test_bitcoin_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,63 +42,3 @@ def test_is_retrievable(self, request_mock):
'/v1/bitcoin/receivers/%s' % TEST_RESOURCE_ID
)
assert isinstance(resource, stripe.BitcoinReceiver)

# stripe-mock does not handle most write operations anymore so we stub
# each one instead. This endpoint/resource is mostly deprecated today.
# The previous tests already ensure that the request will be routed to the
# correct URL, so we also only test the API operations once.

def test_is_creatable(self, request_mock):
request_mock.stub_request(
'post',
'/v1/bitcoin/receivers',
{
'id': '%s' % TEST_RESOURCE_ID,
'object': 'bitcoin_receiver'
}
)
resource = stripe.BitcoinReceiver.create()
request_mock.assert_requested(
'post',
'/v1/bitcoin/receivers'
)
assert isinstance(resource, stripe.BitcoinReceiver)

def test_is_saveable(self, request_mock):
request_mock.stub_request(
'post',
'/v1/bitcoin/receivers/%s' % TEST_RESOURCE_ID
)
resource = self.construct_resource()
resource.metadata['key'] = 'value'
resource.save()
request_mock.assert_requested(
'post',
'/v1/bitcoin/receivers/%s' % TEST_RESOURCE_ID
)

def test_is_modifiable(self, request_mock):
request_mock.stub_request(
'post',
'/v1/bitcoin/receivers/%s' % TEST_RESOURCE_ID
)
stripe.BitcoinReceiver.modify(
TEST_RESOURCE_ID,
metadata={'key': 'value'}
)
request_mock.assert_requested(
'post',
'/v1/bitcoin/receivers/%s' % TEST_RESOURCE_ID
)

def test_is_deletable(self, request_mock):
request_mock.stub_request(
'delete',
'/v1/bitcoin/receivers/%s' % TEST_RESOURCE_ID
)
resource = self.construct_resource()
resource.delete()
request_mock.assert_requested(
'delete',
'/v1/bitcoin/receivers/%s' % TEST_RESOURCE_ID
)

0 comments on commit d715011

Please sign in to comment.