Skip to content

Commit

Permalink
API Updates (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe authored Jun 4, 2021
1 parent da31f89 commit 4181ece
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cache:
env:
global:
# If changing this number, please also change it in `tests/conftest.py`.
- STRIPE_MOCK_VERSION=0.105.0
- STRIPE_MOCK_VERSION=0.106.0

before_install:
# Unpack and start stripe-mock so that the test suite can talk to it
Expand Down
1 change: 1 addition & 0 deletions stripe/api_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
from stripe.api_resources.subscription import Subscription
from stripe.api_resources.subscription_item import SubscriptionItem
from stripe.api_resources.subscription_schedule import SubscriptionSchedule
from stripe.api_resources.tax_code import TaxCode
from stripe.api_resources.tax_id import TaxId
from stripe.api_resources.tax_rate import TaxRate
from stripe.api_resources.three_d_secure import ThreeDSecure
Expand Down
7 changes: 7 additions & 0 deletions stripe/api_resources/tax_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import absolute_import, division, print_function

from stripe.api_resources.abstract import ListableAPIResource


class TaxCode(ListableAPIResource):
OBJECT_NAME = "tax_code"
1 change: 1 addition & 0 deletions stripe/object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
api_resources.Subscription.OBJECT_NAME: api_resources.Subscription,
api_resources.SubscriptionItem.OBJECT_NAME: api_resources.SubscriptionItem,
api_resources.SubscriptionSchedule.OBJECT_NAME: api_resources.SubscriptionSchedule,
api_resources.TaxCode.OBJECT_NAME: api_resources.TaxCode,
api_resources.TaxId.OBJECT_NAME: api_resources.TaxId,
api_resources.TaxRate.OBJECT_NAME: api_resources.TaxRate,
api_resources.terminal.ConnectionToken.OBJECT_NAME: api_resources.terminal.ConnectionToken,
Expand Down
21 changes: 21 additions & 0 deletions tests/api_resources/test_tax_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from __future__ import absolute_import, division, print_function

import stripe


TEST_RESOURCE_ID = "txcd_123"


class TestTaxCode(object):
def test_is_listable(self, request_mock):
resources = stripe.TaxCode.list()
request_mock.assert_requested("get", "/v1/tax_codes")
assert isinstance(resources.data, list)
assert isinstance(resources.data[0], stripe.TaxCode)

def test_is_retrievable(self, request_mock):
resource = stripe.TaxCode.retrieve(TEST_RESOURCE_ID)
request_mock.assert_requested(
"get", "/v1/tax_codes/%s" % TEST_RESOURCE_ID
)
assert isinstance(resource, stripe.TaxCode)
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


# When changing this number, don't forget to change it in `.travis.yml` too.
MOCK_MINIMUM_VERSION = "0.105.0"
MOCK_MINIMUM_VERSION = "0.106.0"

# Starts stripe-mock if an OpenAPI spec override is found in `openapi/`, and
# otherwise fall back to `STRIPE_MOCK_PORT` or 12111.
Expand Down

0 comments on commit 4181ece

Please sign in to comment.