-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add export command to dem #66
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following options don't work (Assuming the Tutorial Dev Env is available):
dem export Tutorial ~/test.json
dem export Tutorial
tests/cli/test_export_cmd.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to achieve 100% code coverage: test cases are missing for the execute() function. The execute() function should be tested through the CLI runner (for example: runner.invoke(main.typer_cli, ["export", "Cica", "home"]
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
dem/cli/command/export_cmd.py
Outdated
from dem.cli.console import stderr | ||
import json, os | ||
|
||
def check_is_file(param): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
dem/cli/command/export_cmd.py
Outdated
def check_is_directory(param): | ||
return(os.path.isdir(param)) | ||
|
||
def create_exported_dev_env_json(dev_env_name,dev_env_json,given_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add type annotations for both the params and the return value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
dem/cli/main.py
Outdated
@@ -62,6 +62,14 @@ def create(dev_env_name: str = typer.Argument(..., | |||
""" | |||
create_cmd.execute(dev_env_name) | |||
|
|||
@typer_cli.command() | |||
def export(dev_env_name: str = typer.Argument(...,help="Name of the Development Environment to export."), | |||
path_to_export: str = typer.Argument(...,help="Path where to extract the Dev Env.")) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the path_to_export option optional: typer.Argument(None, help="")
. This scenario needs to be handled in the create_exported_dev_env_json()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
No description provided.