@@ -20,6 +20,17 @@ func TestContextData(t *testing.T) {
2020 name = "Provider test context %s"
2121 description = "description"
2222 labels = ["one", "two"]
23+ after_apply = ["after_apply"]
24+ after_destroy = ["after_destroy"]
25+ after_init = ["after_init"]
26+ after_perform = ["after_perform"]
27+ after_plan = ["after_plan"]
28+ after_run = ["after_run"]
29+ before_apply = ["before_apply"]
30+ before_destroy = ["before_destroy"]
31+ before_init = ["before_init"]
32+ before_perform = ["before_perform"]
33+ before_plan = ["before_plan"]
2334 }
2435 data "spacelift_context" "test" {
2536 context_id = spacelift_context.test.id
@@ -31,6 +42,28 @@ func TestContextData(t *testing.T) {
3142 Attribute ("name" , StartsWith ("Provider test context" )),
3243 Attribute ("description" , Equals ("description" )),
3344 SetEquals ("labels" , "one" , "two" ),
45+ Attribute ("after_apply.#" , Equals ("1" )),
46+ Attribute ("after_apply.0" , Equals ("after_apply" )),
47+ Attribute ("after_destroy.#" , Equals ("1" )),
48+ Attribute ("after_destroy.0" , Equals ("after_destroy" )),
49+ Attribute ("after_init.#" , Equals ("1" )),
50+ Attribute ("after_init.0" , Equals ("after_init" )),
51+ Attribute ("after_perform.#" , Equals ("1" )),
52+ Attribute ("after_perform.0" , Equals ("after_perform" )),
53+ Attribute ("after_plan.#" , Equals ("1" )),
54+ Attribute ("after_plan.0" , Equals ("after_plan" )),
55+ Attribute ("after_run.#" , Equals ("1" )),
56+ Attribute ("after_run.0" , Equals ("after_run" )),
57+ Attribute ("before_apply.#" , Equals ("1" )),
58+ Attribute ("before_apply.0" , Equals ("before_apply" )),
59+ Attribute ("before_destroy.#" , Equals ("1" )),
60+ Attribute ("before_destroy.0" , Equals ("before_destroy" )),
61+ Attribute ("before_init.#" , Equals ("1" )),
62+ Attribute ("before_init.0" , Equals ("before_init" )),
63+ Attribute ("before_perform.#" , Equals ("1" )),
64+ Attribute ("before_perform.0" , Equals ("before_perform" )),
65+ Attribute ("before_plan.#" , Equals ("1" )),
66+ Attribute ("before_plan.0" , Equals ("before_plan" )),
3467 ),
3568 }})
3669 })
0 commit comments