Skip to content

Commit

Permalink
Rename regular step to r and verify to v to make things easier
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr <piotrzan@gmail.com>
  • Loading branch information
Piotr1215 committed Jul 30, 2024
1 parent d5dede2 commit 61ef80e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions killercoda_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def calculate_new_step_file_operations(
FileOperation("write_file", new_step_md, content=f"# {step_title}\n"),
]

if step_type == "regular":
if step_type == "r":
new_step_background = f"{new_step_folder}/background.sh"
new_step_foreground = f"{new_step_folder}/foreground.sh"

Expand All @@ -270,7 +270,7 @@ def calculate_new_step_file_operations(
FileOperation("chmod", new_step_foreground, mode=0o755),
]

elif step_type == "verify":
elif step_type == "v":
new_step_verify = f"{new_step_folder}/verify.sh"

file_operations += [
Expand Down Expand Up @@ -306,7 +306,7 @@ def calculate_index_json_updates(insert_step_num, step_title, current_index_data
"title": step_title,
"text": f"step{insert_step_num}/step{insert_step_num}.md",
}
if step_type == "verify":
if step_type == "v":
new_step_data["verify"] = f"step{insert_step_num}/verify.sh"
else: # Default to "regular"
new_step_data["background"] = f"step{insert_step_num}/background.sh"
Expand Down Expand Up @@ -423,7 +423,7 @@ def main():
step_number_input = input(
f"Enter the step number to insert the new step at (1-{highest_step_num+1}): "
)
step_type = input("Enter the type of step (regular or verify): ")
step_type = input("Enter the type of step (r for regular or v for verify): ")
step_title, insert_step_num = get_user_input(
steps_dict, step_title_input, step_number_input
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def isfile_side_effect(path):
def test_calculate_new_step_file_operations(self):
insert_step_num = 4
step_title = "New Step"
step_type = "regular" # Assuming "regular" is a valid step type. Adjust as necessary.
step_type = "r" # Assuming "r" is a valid step type. Adjust as necessary.
expected_operations = [
FileOperation("makedirs", "step4"),
FileOperation("write_file", "step4/step4.md", content="# New Step\n"),
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_calculate_new_step_file_operations(self):
def test_calculate_index_json_updates_for_verify(self):
insert_step_num = 2
step_title = "New Step"
step_type = "verify"
step_type = "v"
current_index_data = {
"details": {
"steps": [
Expand Down

0 comments on commit 61ef80e

Please sign in to comment.