-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbf4a3a
commit 6ae7ee2
Showing
10 changed files
with
195 additions
and
81 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
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,18 +1,23 @@ | ||
import pytest | ||
from shopify_client.endpoint import DraftOrdersEndpoint | ||
|
||
|
||
@pytest.fixture | ||
def draft_orders_endpoint(mock_client): | ||
return DraftOrdersEndpoint(client=mock_client, endpoint="draft_orders") | ||
|
||
|
||
def test_complete_draft_order(draft_orders_endpoint, mock_client): | ||
mock_client.request.return_value = {"result": "completed"} | ||
response = draft_orders_endpoint.complete(1) | ||
mock_client.request.assert_called_once_with("PUT", "draft_orders/1/complete.json") | ||
assert response == {"result": "completed"} | ||
|
||
|
||
def test_send_invoice(draft_orders_endpoint, mock_client): | ||
mock_client.request.return_value = {"result": "invoice_sent"} | ||
response = draft_orders_endpoint.send_invoice(1) | ||
mock_client.request.assert_called_once_with("PUT", "draft_orders/1/send_invoice.json") | ||
mock_client.request.assert_called_once_with( | ||
"PUT", "draft_orders/1/send_invoice.json" | ||
) | ||
assert response == {"result": "invoice_sent"} |
Oops, something went wrong.