-
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.
## Changes This PR adds a Managed Volume fixture from Unity Catalog, allowing testers to create and use a random volume in the catalog. ### Linked issues Resolves #70 . ### Tests - [x] manually tested - [x] added unit tests - [x] added integration tests - [ ] verified on staging environment (screenshot attached) --------- Co-authored-by: chris.grant <[email protected]>
- Loading branch information
1 parent
9d209d2
commit 18948fe
Showing
5 changed files
with
133 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from unittest.mock import ANY | ||
|
||
from databricks.sdk.service.catalog import TableInfo, TableType, DataSourceFormat, FunctionInfo, SchemaInfo | ||
from databricks.sdk.service.catalog import TableInfo, TableType, DataSourceFormat, FunctionInfo, SchemaInfo, VolumeType, VolumeInfo | ||
|
||
from databricks.labs.pytester.fixtures.unwrap import call_stateful | ||
from databricks.labs.pytester.fixtures.catalog import ( | ||
|
@@ -9,6 +9,7 @@ | |
make_catalog, | ||
make_storage_credential, | ||
make_schema, | ||
make_volume, | ||
) | ||
|
||
|
||
|
@@ -157,3 +158,20 @@ def test_make_schema() -> None: | |
full_name='hive_metastore.abc', | ||
storage_location='abfss://[email protected]', | ||
) | ||
|
||
|
||
def test_make_volume_noargs(): | ||
ctx, info = call_stateful(make_volume) | ||
ctx['ws'].volumes.create.assert_called_once() | ||
assert info is not None | ||
|
||
|
||
def test_make_volume_with_name(): | ||
ctx, info = call_stateful(make_volume, name='test_volume') | ||
ctx['ws'].volumes.create.assert_called_once_with( | ||
name='test_volume', | ||
catalog_name="dummy_crandom", | ||
schema_name="dummy_srandom", | ||
volume_type=VolumeType.MANAGED | ||
) | ||
assert info is not None |