-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split management plane and data plane operations.
- Loading branch information
Showing
8 changed files
with
73 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.17.8" | ||
__version__ = "0.17.12" |
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,25 @@ | ||
from unittest.mock import AsyncMock, MagicMock, patch | ||
from azure.core.exceptions import AzureError | ||
from api_app.db import events | ||
|
||
|
||
@patch("api_app.db.events.get_credential_async") | ||
@patch("api_app.db.events.CosmosDBManagementClient") | ||
async def test_bootstrap_database_success(cosmos_db_mgmt_client_mock, get_credential_async_mock): | ||
get_credential_async_mock.return_value = AsyncMock() | ||
cosmos_db_mgmt_client_mock.return_value = MagicMock() | ||
|
||
result = await events.bootstrap_database() | ||
|
||
assert result is True | ||
|
||
|
||
@patch("api_app.db.events.get_credential_async") | ||
@patch("api_app.db.events.CosmosDBManagementClient") | ||
async def test_bootstrap_database_failure(cosmos_db_mgmt_client_mock, get_credential_async_mock): | ||
get_credential_async_mock.return_value = AsyncMock() | ||
cosmos_db_mgmt_client_mock.side_effect = AzureError() | ||
|
||
result = await events.bootstrap_database() | ||
|
||
assert result is False |
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