-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move settings validation to startup check
- Loading branch information
1 parent
fca13de
commit 02479ae
Showing
3 changed files
with
33 additions
and
30 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 was deleted.
Oops, something went wrong.
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,22 @@ | ||
import pytest | ||
|
||
from pccommon.config.core import TableConfig | ||
|
||
|
||
def test_raises_on_non_azurite_account_url() -> None: | ||
|
||
invalid_url = "https://example.com" | ||
with pytest.raises(ValueError) as exc_info: | ||
TableConfig(account_url=invalid_url, table_name="test", account_name="test") | ||
|
||
assert ( | ||
"Non-azurite account url provided. " | ||
"Account keys can only be used with Azurite emulator." | ||
) in str(exc_info.value) | ||
|
||
|
||
def test_settings_accepts_azurite_url() -> None: | ||
valid_url = "http://azurite:12345" | ||
|
||
config = TableConfig(account_url=valid_url, table_name="test", account_name="test") | ||
assert config.account_url == valid_url |