-
Notifications
You must be signed in to change notification settings - Fork 3
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 #9 from naodeng/main
add demo for multi env support
- Loading branch information
Showing
8 changed files
with
37 additions
and
23 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
File renamed without changes.
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"postAPI":{ | ||
"title": "foo", | ||
"body": "bar", | ||
"userId": 1, | ||
"userId": "1", | ||
"id": 101 | ||
} | ||
} |
File renamed without changes.
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"postAPI":{ | ||
"title": "foo", | ||
"body": "bar", | ||
"userId": 1, | ||
"userId": "1", | ||
"id": 101 | ||
} | ||
} |
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 @@ | ||
import requests | ||
import json | ||
|
||
|
||
class TestPytestMultiEnvDemo: | ||
|
||
def test_get_demo_multi_env(self, env_config, env_request_data, env_response_data): | ||
host = env_config["host"] | ||
get_api = env_config["getAPI"] | ||
get_api_response_data = env_response_data["getAPI"] | ||
# send request | ||
response = requests.get(host+get_api) | ||
# assert | ||
assert response.status_code == 200 | ||
assert response.json() == get_api_response_data | ||
|
||
def test_post_demo_multi_env(self, env_config, env_request_data, env_response_data): | ||
host = env_config["host"] | ||
post_api = env_config["postAPI"] | ||
post_api_request_data = env_request_data["postAPI"] | ||
post_api_response_data = env_response_data["postAPI"] | ||
# send request | ||
response = requests.post(host + post_api, post_api_request_data) | ||
# assert | ||
assert response.status_code == 201 | ||
assert response.json() == post_api_response_data |