Skip to content

Commit

Permalink
add --vars handling in TestModifiedVars
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Jul 29, 2024
1 parent 8ff33f9 commit 22621ac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/functional/defer_state/test_modified_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,11 +1166,22 @@ def test_changed_vars(self, project):
assert not run_dbt(["list", "-s", "state:modified", "--state", "./state"])
assert not run_dbt(["list", "-s", "state:modified.vars", "--state", "./state"])

# Modify var (my_var: 1 -> 2
# Modify var (my_var: 1 -> 2)
update_config_file({"vars": {"my_var": 2}}, "dbt_project.yml")
assert run_dbt(["list", "-s", "state:modified", "--state", "./state"]) == [
"test.view_model"
]
assert run_dbt(["list", "-s", "state:modified.vars", "--state", "./state"]) == [
"test.view_model"
]

# Reset dbt_project.yml
update_config_file({"vars": {"my_var": 1}}, "dbt_project.yml")

# Modify var via --var CLI flag
assert not run_dbt(
["list", "--vars", '{"my_var": 1}', "-s", "state:modified", "--state", "./state"]
)
assert run_dbt(
["list", "--vars", '{"my_var": 2}', "-s", "state:modified", "--state", "./state"]
) == ["test.view_model"]

0 comments on commit 22621ac

Please sign in to comment.