Skip to content

Commit

Permalink
updated tests for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBones757 committed Nov 16, 2023
1 parent 3947238 commit dfdddd7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ def test_profile_config_validate_both():
)


def test_profile_config_validate_profiles_yml():
profile_config = ProfileConfig(profile_name="test", target_name="test", profiles_yml_filepath="/tmp/no-exists")
with pytest.raises(CosmosValueError) as err_info:
profile_config.validate_profiles_yml()

assert err_info.value.args[0] == "The file /tmp/no-exists does not exist."


@patch("cosmos.config.shutil.which", return_value=None)
def test_render_config_without_dbt_cmd(mock_which):
render_config = RenderConfig()
Expand Down
13 changes: 13 additions & 0 deletions tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ def test_validate_arguments_tags(argument_key):
assert err.value.args[0] == expected


def test_validate_arguments_schema_in_task_args():
profile_config = ProfileConfig(
profile_name="test",
target_name="test",
profile_mapping=PostgresUserPasswordProfileMapping(conn_id="test", profile_args={}),
)
task_args = {"schema": "abcd"}
validate_arguments(
select=[], exclude=[], profile_config=profile_config, task_args=task_args, execution_mode=ExecutionMode.LOCAL
)
assert profile_config.profile_mapping.profile_args["schema"] == "abcd"


parent_seed = DbtNode(
name="seed_parent",
unique_id="seed_parent",
Expand Down

0 comments on commit dfdddd7

Please sign in to comment.