-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from prkumar/master
Release v0.9.5
- Loading branch information
Showing
25 changed files
with
134 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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 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 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,14 +1,14 @@ | ||
repos: | ||
- repo: https://github.com/ambv/black | ||
rev: 18.6b4 | ||
rev: 21.12b0 | ||
hooks: | ||
- id: black | ||
python-version: python3.6 | ||
python-version: python3.8 | ||
files: ^((uplink|examples|tests)\/.+|setup|docs\/conf)\.py$ | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v1.3.0 | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: '4.0.1' | ||
hooks: | ||
- id: flake8 | ||
name: flake8 | ||
python-version: python3.6 | ||
python-version: python3.8 | ||
files: ^((uplink|examples|tests)\/.+|setup|docs\/conf)\.py$ |
This file contains 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 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Local imports | ||
from uplink import Consumer, form_url_encoded, put, FieldMap | ||
|
||
# Constants | ||
BASE_URL = "https://example.com/" | ||
|
||
|
||
def test_without_converter(mock_response, mock_client): | ||
class Calendar(Consumer): | ||
@form_url_encoded | ||
@put("/user/repos", args={"event_data": FieldMap}) | ||
def add_event(self, **event_data): | ||
pass | ||
|
||
mock_client.with_response(mock_response) | ||
calendar = Calendar(base_url=BASE_URL, client=mock_client) | ||
|
||
# Run | ||
calendar.add_event(name="Weekly Stand-up", public=True) | ||
|
||
# Assertions: should not convert if converter is None | ||
request = mock_client.history[0] | ||
assert request.data == {"name": "Weekly Stand-up", "public": True} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Local imports | ||
from uplink import Consumer, PartMap, post, multipart | ||
|
||
# Constants | ||
BASE_URL = "https://example.com/" | ||
|
||
|
||
def test_without_converter(mock_response, mock_client): | ||
class Calendar(Consumer): | ||
@multipart | ||
@post("/attachments", args={"files": PartMap}) | ||
def upload_attachments(self, **files): | ||
pass | ||
|
||
mock_client.with_response(mock_response) | ||
calendar = Calendar(base_url=BASE_URL, client=mock_client) | ||
file = object() | ||
|
||
# Run | ||
calendar.upload_attachments(file=file) | ||
|
||
# Assertion: should not convert if converter is None | ||
request = mock_client.history[0] | ||
assert request.files == {"file": file} |
This file contains 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 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 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 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 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 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
Oops, something went wrong.