コード例 #1
0
    def test_nested_config(self):
        if get_test_org() != "pulumi-test":
            return
        stack_name = fully_qualified_stack_name("pulumi-test", "nested_config",
                                                "dev")
        project_dir = test_path("data", "nested_config")
        stack = create_or_select_stack(stack_name, work_dir=project_dir)

        all_config = stack.get_all_config()
        outer_val = all_config["nested_config:outer"]
        self.assertTrue(outer_val.secret)
        self.assertEqual(
            outer_val.value,
            "{\"inner\":\"my_secret\",\"other\":\"something_else\"}")

        list_val = all_config["nested_config:myList"]
        self.assertFalse(list_val.secret)
        self.assertEqual(list_val.value, "[\"one\",\"two\",\"three\"]")

        outer = stack.get_config("outer")
        self.assertTrue(outer.secret)
        self.assertEqual(
            outer_val.value,
            "{\"inner\":\"my_secret\",\"other\":\"something_else\"}")

        arr = stack.get_config("myList")
        self.assertFalse(arr.secret)
        self.assertEqual(arr.value, "[\"one\",\"two\",\"three\"]")
コード例 #2
0
def stack_namer(project_name):
    return fully_qualified_stack_name(get_test_org(), project_name,
                                      f"int_test_{get_test_suffix()}")