-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36a8aa3
commit 02c9114
Showing
1 changed file
with
11 additions
and
10 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,37 +1,38 @@ | ||
import os | ||
from unittest.mock import MagicMock | ||
from unittest.mock import patch | ||
|
||
from dapla.gcs import GCSFileSystem | ||
|
||
|
||
@patch('google.auth.default', return_value=(None, None)) | ||
def test_instance(mock_auth) -> None: | ||
@patch("google.auth.default", return_value=(None, None)) | ||
def test_instance(mock_auth: MagicMock) -> None: | ||
client = GCSFileSystem() | ||
assert client is not None | ||
|
||
|
||
@patch('google.auth.default', return_value=(None, None)) | ||
def test_init_with_dapla_lab(mock_auth) -> None: | ||
@patch("google.auth.default", return_value=(None, None)) | ||
def test_init_with_dapla_lab(mock_auth: MagicMock) -> None: | ||
os.environ["DAPLA_REGION"] = "dapla-lab" | ||
client = GCSFileSystem(project="test-project") | ||
assert client is not None | ||
|
||
|
||
@patch('google.auth.default', return_value=(None, None)) | ||
def test_init_with_cloud_run(mock_auth) -> None: | ||
@patch("google.auth.default", return_value=(None, None)) | ||
def test_init_with_cloud_run(mock_auth: MagicMock) -> None: | ||
os.environ["DAPLA_REGION"] = "cloud-run" | ||
client = GCSFileSystem(project="test-project") | ||
assert client is not None | ||
|
||
|
||
@patch('google.auth.default', return_value=(None, None)) | ||
def test_init_with_custom_region(mock_auth) -> None: | ||
@patch("google.auth.default", return_value=(None, None)) | ||
def test_init_with_custom_region(mock_auth: MagicMock) -> None: | ||
os.environ["DAPLA_REGION"] = "custom-region" | ||
client = GCSFileSystem(project="test-project") | ||
assert client is not None | ||
|
||
|
||
@patch('google.auth.default', return_value=(None, None)) | ||
def test_init_with_additional_kwargs(mock_auth) -> None: | ||
@patch("google.auth.default", return_value=(None, None)) | ||
def test_init_with_additional_kwargs(mock_auth: MagicMock) -> None: | ||
client = GCSFileSystem(project="test-project", timeout=100) | ||
assert client is not None |