-
Notifications
You must be signed in to change notification settings - Fork 2
Remove /estimates/ecommerce endpoint calls #79
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ba5c154
Remove /estimates/ecommerce endpoint calls
holtbp 1f6caec
Pin the version of black being used
pcothenet f7ec16a
Latest ubuntu?
pcothenet 16bdc4d
Bump test version
pcothenet e086081
Do we even need to set up Python?
pcothenet 59a0b8a
Clean up .DS_Store
pcothenet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,25 +12,16 @@ jobs: | |
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | ||
- uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # v2.3.4 | ||
- uses: psf/black@stable | ||
|
||
with: | ||
version: "24.10.0" | ||
|
||
build-and-test: | ||
# 03/27/23: it looks like there are issues with the tarballs for all python 3.6 versions | ||
# that are on ubuntu-22.04 (ubuntu-latest at the time). To maintain python compatibility | ||
# we're pinning ubuntu-20.04 so that we can properly run install python 3.6. | ||
# | ||
# As soon as this issue is addressed, we should put the image back to ubuntu-latest: | ||
# https://github.com/actions/setup-python/issues/544 | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
name: Python Library tests | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # v2.3.4 | ||
with: | ||
python-version: '3.6' | ||
Comment on lines
-29
to
-32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not need this since |
||
|
||
- name: Run tests | ||
env: | ||
SANDBOX_API_KEY: ${{ secrets.SANDBOX_API_KEY }} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# coding: utf-8 | ||
""" | ||
Patch API V2 | ||
Patch API V2 | ||
|
||
The core API used to integrate with Patch's service # noqa: E501 | ||
The core API used to integrate with Patch's service # noqa: E501 | ||
|
||
The version of the OpenAPI document: 2 | ||
Contact: [email protected] | ||
Generated by: https://openapi-generator.tech | ||
The version of the OpenAPI document: 2 | ||
Contact: [email protected] | ||
Generated by: https://openapi-generator.tech | ||
""" | ||
|
||
from __future__ import absolute_import | ||
|
@@ -92,7 +92,7 @@ def __init__( | |
self.default_headers[header_name] = header_value | ||
self.cookie = cookie | ||
# Set default User-Agent. | ||
self.user_agent = "patch-python/2.3.0" | ||
self.user_agent = "patch-python/2.3.1" | ||
# Set default Patch-Version | ||
self.patch_version = 2 | ||
|
||
|
@@ -130,9 +130,6 @@ def user_agent(self): | |
def user_agent(self, value): | ||
self.default_headers["User-Agent"] = value | ||
|
||
def set_default_header(self, header_name, header_value): | ||
self.default_headers[header_name] = header_value | ||
|
||
@property | ||
def patch_version(self): | ||
"""API version for this API client""" | ||
|
@@ -142,6 +139,9 @@ def patch_version(self): | |
def patch_version(self, value): | ||
self.default_headers["Patch-Version"] = value | ||
|
||
def set_default_header(self, header_name, header_value): | ||
self.default_headers[header_name] = header_value | ||
|
||
def __call_api( | ||
self, | ||
resource_path, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Patch API V1 | ||
Patch API V1 | ||
|
||
The core API used to integrate with Patch's service # noqa: E501 | ||
The core API used to integrate with Patch's service # noqa: E501 | ||
|
||
The version of the OpenAPI document: v1 | ||
Contact: [email protected] | ||
Generated by: https://openapi-generator.tech | ||
The version of the OpenAPI document: v1 | ||
Contact: [email protected] | ||
Generated by: https://openapi-generator.tech | ||
""" | ||
|
||
|
||
|
@@ -113,27 +113,6 @@ def test_create_hotel_estimate(self): | |
estimate.data.mass_g, 15_000 | ||
) # not setting an exact value since this is changing daily | ||
|
||
def test_create_and_retrieve_ecommerce_estimate(self): | ||
"""Test case for create_ecommerce_estimate | ||
|
||
Create an estimate based on the shipping distance, transportation method, and package mass # noqa: E501 | ||
""" | ||
distance_m = 10000000 | ||
package_mass_g = 1000 | ||
transportation_method = "sea" | ||
estimate = self.api.create_ecommerce_estimate( | ||
distance_m=distance_m, | ||
package_mass_g=package_mass_g, | ||
transportation_method=transportation_method, | ||
create_order=False, | ||
) | ||
self.assertEqual(estimate.data.order, None) | ||
self.assertEqual(estimate.data.type, "ecommerce") | ||
self.assertGreater(estimate.data.mass_g, 200) | ||
|
||
retrieved_estimate = self.api.retrieve_estimate(id=estimate.data.id) | ||
self.assertTrue(retrieved_estimate) | ||
|
||
def test_create_air_shipping_estimate_airport_iatas(self): | ||
"""Test case for create_air_shipping_estimate | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were getting some issues due to inconsistent versions of black.