diff --git a/src/rpdk/core/project.py b/src/rpdk/core/project.py index 6223beac..64121d3f 100644 --- a/src/rpdk/core/project.py +++ b/src/rpdk/core/project.py @@ -33,6 +33,7 @@ SCHEMA_UPLOAD_FILENAME = "schema.json" OVERRIDES_FILENAME = "overrides.json" INPUTS_FOLDER = "inputs" +EXAMPLE_INPUTS_FOLDER = "example_inputs" ROLE_TEMPLATE_FILENAME = "resource-role.yaml" TYPE_NAME_REGEX = "^[a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}$" @@ -147,6 +148,10 @@ def overrides_path(self): def inputs_path(self): return self.root / INPUTS_FOLDER + @property + def example_inputs_path(self): + return self.root / EXAMPLE_INPUTS_FOLDER + @staticmethod def _raise_invalid_project(msg, e): LOG.debug(msg, exc_info=e) @@ -191,8 +196,8 @@ def _write(f): def _write_example_inputs(self): - shutil.rmtree(self.inputs_path, ignore_errors=True) - self.inputs_path.mkdir(exist_ok=True) + shutil.rmtree(self.example_inputs_path, ignore_errors=True) + self.example_inputs_path.mkdir(exist_ok=True) template = self.env.get_template("inputs.json") properties = list(self.schema["properties"].keys()) @@ -203,7 +208,7 @@ def _write_example_inputs(self): "inputs_1_invalid.json", ): self.safewrite( - self.inputs_path / inputs_file, + self.example_inputs_path / inputs_file, template.render( properties=properties[:-1], last_property=properties[-1] ), diff --git a/tests/test_project.py b/tests/test_project.py index 4efc50cd..6a7190a4 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -478,7 +478,7 @@ def test_init(project): "inputs_1_update.json", "inputs_1_invalid.json", ): - path_file = project.inputs_path / file_inputs + path_file = project.example_inputs_path / file_inputs with path_file.open("r", encoding="utf-8") as f: assert json.load(f)