From 5a6cc67713370914e721a7dd817cfa5682f24323 Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Tue, 10 Dec 2024 14:09:56 +0000 Subject: [PATCH] Fix unittests --- tests/dbt/test_graph.py | 16 ++++++++-------- tests/dbt/test_project.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/dbt/test_graph.py b/tests/dbt/test_graph.py index 0391cc73d..587ef1766 100644 --- a/tests/dbt/test_graph.py +++ b/tests/dbt/test_graph.py @@ -845,18 +845,18 @@ def test_load_via_dbt_ls_with_runtime_error_in_stdout(mock_popen_communicate, po mock_popen_communicate.assert_called_once() -@pytest.mark.parametrize("project_name", ("jaffle_shop", "jaffle_shop_python")) -def test_load_via_load_via_custom_parser(project_name): +@pytest.mark.parametrize("project_name,nodes_count", [("altered_jaffle_shop", 29), ("jaffle_shop_python", 28)]) +def test_load_via_load_via_custom_parser(project_name, nodes_count): project_config = ProjectConfig(dbt_project_path=DBT_PROJECTS_ROOT_DIR / project_name) - execution_config = ExecutionConfig(dbt_project_path=DBT_PROJECTS_ROOT_DIR / DBT_PROJECT_NAME) + execution_config = ExecutionConfig(dbt_project_path=DBT_PROJECTS_ROOT_DIR / project_name) render_config = RenderConfig( - dbt_project_path=DBT_PROJECTS_ROOT_DIR / DBT_PROJECT_NAME, + dbt_project_path=DBT_PROJECTS_ROOT_DIR / project_name, source_rendering_behavior=SOURCE_RENDERING_BEHAVIOR, ) profile_config = ProfileConfig( profile_name="test", target_name="test", - profiles_yml_filepath=DBT_PROJECTS_ROOT_DIR / DBT_PROJECT_NAME / "profiles.yml", + profiles_yml_filepath=DBT_PROJECTS_ROOT_DIR / project_name / "profiles.yml", ) dbt_graph = DbtGraph( project=project_config, @@ -868,7 +868,7 @@ def test_load_via_load_via_custom_parser(project_name): dbt_graph.load_via_custom_parser() assert dbt_graph.nodes == dbt_graph.filtered_nodes - assert len(dbt_graph.nodes) == 29 + assert len(dbt_graph.nodes) == nodes_count def test_load_via_load_via_custom_parser_select_rendering_config(): @@ -1574,9 +1574,9 @@ def test_save_dbt_ls_cache(mock_variable_set, mock_datetime, tmp_dbt_project_dir hash_dir, hash_args = version.split(",") assert hash_args == "d41d8cd98f00b204e9800998ecf8427e" if sys.platform == "darwin": - assert hash_dir == "c071049cc70ca52d74cf0845f15ae12d" + assert hash_dir == "512856ce9da2ce2255524aec677dfc6a" else: - assert hash_dir == "a432b2d06e6badd7c00dbaf4141d7292" + assert hash_dir == "6563b6c21f143f7133a85e1b904efc25" @pytest.mark.integration diff --git a/tests/dbt/test_project.py b/tests/dbt/test_project.py index df625182f..161b32f46 100644 --- a/tests/dbt/test_project.py +++ b/tests/dbt/test_project.py @@ -14,7 +14,7 @@ def test_create_symlinks(tmp_path): tmp_dir = tmp_path / "dbt-project" tmp_dir.mkdir() - create_symlinks(DBT_PROJECTS_ROOT_DIR / "jaffle_shop", tmp_dir, False) + create_symlinks(DBT_PROJECTS_ROOT_DIR / "altered_jaffle_shop", tmp_dir, False) for child in tmp_dir.iterdir(): assert child.is_symlink() assert child.name not in ("logs", "target", "profiles.yml", "dbt_packages")