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

Update generated code for beta #964

Merged
merged 5 commits into from
Apr 27, 2023
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
35 changes: 12 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: lint
Expand All @@ -36,10 +36,10 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python 3
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.10"

Expand All @@ -54,7 +54,7 @@ jobs:
python -m twine check dist/*

- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
Expand All @@ -81,29 +81,18 @@ jobs:
]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "setup.py"

- name: Upgrade pip and virtualenv to latest
run: pip install --upgrade pip virtualenv

- name: Get pip cache dir
id: pip-cache
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"

- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-

- uses: stripe/openapi/actions/stripe-mock@master

- name: Test with pytest
Expand All @@ -125,14 +114,14 @@ jobs:
needs: [build, test, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Set up Python 3
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.10"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test-nomock: venv

ci-test: venv
${VENV_NAME}/bin/python -m pip install -U tox-gh-actions
@${VENV_NAME}/bin/tox -p auto $(TOX_ARGS)
@${VENV_NAME}/bin/tox $(TOX_ARGS)

coveralls: venv
${VENV_NAME}/bin/python -m pip install -U coveralls
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v305
v316
9 changes: 9 additions & 0 deletions tests/test_generated_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,15 @@ def test_plan_create(self, request_mock):
)
request_mock.assert_requested("post", "/v1/plans")

def test_plan_create2(self, request_mock):
stripe.Plan.create(
amount=2000,
currency="usd",
interval="month",
product={"name": "My product"},
)
request_mock.assert_requested("post", "/v1/plans")

def test_plan_delete(self, request_mock):
stripe.Plan.delete("price_xxxxxxxxxxxxx")
request_mock.assert_requested(
Expand Down
3 changes: 0 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ passenv = GITHUB_*
deps =
coverage >= 4.5.3, < 5 # TODO: upgrade to coverage 5 when we drop support for Python 3.4
coveralls
pytest
pytest-mock
commands =
coverage run --source=stripe -m pytest tests/
coverage combine
coveralls --service=github
depends = py{310,39,38,37,36,35,34,27,py3,py2}