-
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.
implement bin/get_current_product_for_app
- Loading branch information
Showing
4 changed files
with
69 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
command |
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,37 @@ | ||
from hypernode_api_python.commands import get_current_product_for_app | ||
from tests.testcase import TestCase | ||
|
||
|
||
class TestGetCurrentProductForApp(TestCase): | ||
def setUp(self): | ||
self.print_response = self.set_up_patch( | ||
"hypernode_api_python.commands.print_response" | ||
) | ||
self.get_client = self.set_up_patch("hypernode_api_python.commands.get_client") | ||
self.client = self.get_client.return_value | ||
self.get_app_name = self.set_up_patch( | ||
"hypernode_api_python.commands.get_app_name" | ||
) | ||
self.get_app_name.return_value = "myappname" | ||
|
||
def test_get_current_product_for_app_gets_client(self): | ||
get_current_product_for_app([]) | ||
|
||
self.get_client.assert_called_once_with() | ||
|
||
def test_get_current_product_for_app_gets_app_name(self): | ||
get_current_product_for_app([]) | ||
|
||
self.get_app_name.assert_called_once_with() | ||
|
||
def test_get_current_product_for_app_gets_current_product_for_app(self): | ||
get_current_product_for_app([]) | ||
|
||
self.client.get_current_product_for_app.assert_called_once_with("myappname") | ||
|
||
def test_get_current_product_for_app_prints_current_product_for_app(self): | ||
get_current_product_for_app([]) | ||
|
||
self.print_response.assert_called_once_with( | ||
self.client.get_current_product_for_app.return_value | ||
) |