Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsupported bitcoin endpoint actions #463

Merged
merged 1 commit into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove unsupported bitcoin endpoint actions
  • Loading branch information
tomer-stripe committed Aug 15, 2018
commit 665ed60387492f5030a390069b4d878a883319f8
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
)