Skip to content

Commit 059b858

Browse files
authored
inputs -> example imputs (#571)
1 parent 9e0dca0 commit 059b858

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/rpdk/core/project.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
SCHEMA_UPLOAD_FILENAME = "schema.json"
3434
OVERRIDES_FILENAME = "overrides.json"
3535
INPUTS_FOLDER = "inputs"
36+
EXAMPLE_INPUTS_FOLDER = "example_inputs"
3637
ROLE_TEMPLATE_FILENAME = "resource-role.yaml"
3738
TYPE_NAME_REGEX = "^[a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}$"
3839

@@ -147,6 +148,10 @@ def overrides_path(self):
147148
def inputs_path(self):
148149
return self.root / INPUTS_FOLDER
149150

151+
@property
152+
def example_inputs_path(self):
153+
return self.root / EXAMPLE_INPUTS_FOLDER
154+
150155
@staticmethod
151156
def _raise_invalid_project(msg, e):
152157
LOG.debug(msg, exc_info=e)
@@ -191,8 +196,8 @@ def _write(f):
191196

192197
def _write_example_inputs(self):
193198

194-
shutil.rmtree(self.inputs_path, ignore_errors=True)
195-
self.inputs_path.mkdir(exist_ok=True)
199+
shutil.rmtree(self.example_inputs_path, ignore_errors=True)
200+
self.example_inputs_path.mkdir(exist_ok=True)
196201

197202
template = self.env.get_template("inputs.json")
198203
properties = list(self.schema["properties"].keys())
@@ -203,7 +208,7 @@ def _write_example_inputs(self):
203208
"inputs_1_invalid.json",
204209
):
205210
self.safewrite(
206-
self.inputs_path / inputs_file,
211+
self.example_inputs_path / inputs_file,
207212
template.render(
208213
properties=properties[:-1], last_property=properties[-1]
209214
),

tests/test_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ def test_init(project):
478478
"inputs_1_update.json",
479479
"inputs_1_invalid.json",
480480
):
481-
path_file = project.inputs_path / file_inputs
481+
path_file = project.example_inputs_path / file_inputs
482482
with path_file.open("r", encoding="utf-8") as f:
483483
assert json.load(f)
484484

0 commit comments

Comments
 (0)