-
Notifications
You must be signed in to change notification settings - Fork 58
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
979dc05
commit c68e154
Showing
4 changed files
with
66 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,3 @@ | |
[connections.integration] | ||
schema = "public" | ||
role = "INTEGRATION_TESTS" | ||
|
||
[cli.features] | ||
enable_snowgit = true |
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,36 @@ | ||
import pytest | ||
from tests_integration.snowflake_connector import ( | ||
setup_test_database, | ||
setup_test_schema, | ||
add_uuid_to_name, | ||
) | ||
|
||
|
||
@pytest.mark.integration | ||
def test_connection_test_simple(runner): | ||
result = runner.invoke_with_connection_json(["connection", "test"]) | ||
assert result.exit_code == 0, result.output | ||
assert result.json["Status"] == "OK" | ||
|
||
|
||
@pytest.mark.integration | ||
def test_connection_dashed_database(runner, snowflake_session): | ||
database = add_uuid_to_name("dashed-database") | ||
with setup_test_database(snowflake_session, database): | ||
result = runner.invoke_with_connection_json(["connection", "test"]) | ||
assert result.exit_code == 0, result.output | ||
assert result.json["Database"] == database | ||
|
||
|
||
@pytest.mark.integration | ||
@pytest.mark.skip( | ||
reason="BUG: connections test command seem to override every setting with schema PUBLIC" | ||
) | ||
def test_connection_dashed_schema( | ||
runner, test_database, snowflake_session, snowflake_home | ||
): | ||
schema = "dashed-schema-name" | ||
with setup_test_schema(snowflake_session, schema): | ||
result = runner.invoke_with_connection(["connection", "test", "--debug"]) | ||
assert result.exit_code == 0, result.output | ||
assert f'use schema "{schema}"' in result.output |