Skip to content

Commit

Permalink
remove adapters-irrelevant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Jan 30, 2024
1 parent 33ae245 commit ab04416
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions tests/functional/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,55 +420,6 @@ def setup(self, project):
os.remove(os.path.join(project.project_root, "dbt_project.yml"))


class TestInitInvalidProjectNameCLI(TestInitOutsideOfProjectBase):
@patch("dbt.task.init._get_adapter_plugin_names")
@patch("click.confirm")
@patch("click.prompt")
def test_init_invalid_project_name_cli(
self, mock_prompt, mock_confirm, mock_get_adapter, project_name, project
):
manager = Mock()
manager.attach_mock(mock_prompt, "prompt")
manager.attach_mock(mock_confirm, "confirm")

invalid_name = "name-with-hyphen"
valid_name = project_name
manager.prompt.side_effect = [valid_name]
mock_get_adapter.return_value = [project.adapter.type()]

run_dbt(["init", invalid_name, "--skip-profile-setup"])
manager.assert_has_calls(
[
call.prompt("Enter a name for your project (letters, digits, underscore)"),
]
)


class TestInitInvalidProjectNamePrompt(TestInitOutsideOfProjectBase):
@patch("dbt.task.init._get_adapter_plugin_names")
@patch("click.confirm")
@patch("click.prompt")
def test_init_invalid_project_name_prompt(
self, mock_prompt, mock_confirm, mock_get_adapter, project_name, project
):
manager = Mock()
manager.attach_mock(mock_prompt, "prompt")
manager.attach_mock(mock_confirm, "confirm")

invalid_name = "name-with-hyphen"
valid_name = project_name
manager.prompt.side_effect = [invalid_name, valid_name]
mock_get_adapter.return_value = [project.adapter.type()]

run_dbt(["init", "--skip-profile-setup"])
manager.assert_has_calls(
[
call.prompt("Enter a name for your project (letters, digits, underscore)"),
call.prompt("Enter a name for your project (letters, digits, underscore)"),
]
)


class TestInitInsideProjectAndSkipProfileSetup(TestInitInsideOfProjectBase):
@patch("dbt.task.init._get_adapter_plugin_names")
@patch("click.confirm")
Expand Down

0 comments on commit ab04416

Please sign in to comment.