File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
airflow_dbt_python/operators Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ class DbtLsOperator(DbtBaseOperator):
519519 """
520520
521521 template_fields = (
522- base_template_fields + selection_template_fields + ["resource_type " ]
522+ base_template_fields + selection_template_fields + ["resource_types " ]
523523 )
524524
525525 def __init__ (
Original file line number Diff line number Diff line change @@ -86,3 +86,41 @@ def test_dbt_ls_all(
8686 ]
8787
8888 assert all_files == expected
89+
90+
91+ def test_dbt_ls_all_with_default (
92+ profiles_file ,
93+ dbt_project_file ,
94+ seed_files ,
95+ model_files ,
96+ singular_tests_files ,
97+ generic_tests_files ,
98+ snapshot_files ,
99+ ):
100+ """Test dbt list operator by listing all resources."""
101+ op = DbtLsOperator (
102+ task_id = "dbt_task" ,
103+ project_dir = dbt_project_file .parent ,
104+ profiles_dir = profiles_file .parent ,
105+ do_xcom_push = True ,
106+ )
107+ all_files = op .execute ({})
108+
109+ expected = [
110+ "test.model_1" ,
111+ "test.model_2" ,
112+ "test.model_3" ,
113+ "test.model_4" ,
114+ "test.seed_1" ,
115+ "test.seed_2" ,
116+ "test.snapshot_1.test_snapshot" ,
117+ "test.accepted_values_model_2_field1__123__456" ,
118+ "test.not_null_model_2_field1" ,
119+ "test.not_null_model_2_field2" ,
120+ "test.singular_test_1" ,
121+ "test.singular_test_2" ,
122+ "test.unique_model_2_field1" ,
123+ "test.unique_model_2_field2" ,
124+ ]
125+
126+ assert all_files == expected
You can’t perform that action at this time.
0 commit comments