-
Notifications
You must be signed in to change notification settings - Fork 13
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 #182 from launchableinc/ST-872-flavor-option
[ST-872] add flavor option for create test session
- Loading branch information
Showing
3 changed files
with
56 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from tests.cli_test_case import CliTestCase | ||
import responses # type: ignore | ||
import json | ||
|
||
|
||
class SessionTest(CliTestCase): | ||
|
||
@responses.activate | ||
def test_run_session_without_flavor(self): | ||
result = self.cli("record", "session", "--build", self.build_name) | ||
self.assertEqual(result.exit_code, 0) | ||
|
||
payload = json.loads(responses.calls[0].request.body) | ||
self.assert_json_orderless_equal({"flavors": {}}, payload) | ||
|
||
@responses.activate | ||
def test_run_session_with_flavor(self): | ||
result = self.cli("record", "session", "--build", self.build_name, | ||
"--flavor", "key", "value", "--flavor", "k", "v") | ||
self.assertEqual(result.exit_code, 0) | ||
|
||
payload = json.loads(responses.calls[0].request.body) | ||
self.assert_json_orderless_equal({"flavors": { | ||
"key": "value", | ||
"k": "v", | ||
}}, payload) |