-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor instructions to instructions_url
- Loading branch information
1 parent
ba328b5
commit 329274e
Showing
8 changed files
with
41 additions
and
14 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
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,27 @@ | ||
from exchange.providers.base import MissingProviderEnvVariableError | ||
|
||
|
||
def test_missing_provider_env_variable_error_without_instructions_url(): | ||
env_variable = "API_KEY" | ||
provider = "TestProvider" | ||
error = MissingProviderEnvVariableError(env_variable, provider) | ||
|
||
assert error.env_variable == env_variable | ||
assert error.provider == provider | ||
assert error.instructions_url is None | ||
assert error.message == "Missing environment variable: API_KEY for provider TestProvider." | ||
|
||
|
||
def test_missing_provider_env_variable_error_with_instructions_url(): | ||
env_variable = "API_KEY" | ||
provider = "TestProvider" | ||
instructions_url = "http://example.com/instructions" | ||
error = MissingProviderEnvVariableError(env_variable, provider, instructions_url) | ||
|
||
assert error.env_variable == env_variable | ||
assert error.provider == provider | ||
assert error.instructions_url == instructions_url | ||
assert error.message == ( | ||
"Missing environment variable: API_KEY for provider TestProvider.\n" | ||
" Please see http://example.com/instructions for instructions" | ||
) |