Skip to content
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

Merged
merged 1 commit into from
Aug 2, 2023
Merged

Add export command to dem #66

merged 1 commit into from
Aug 2, 2023

Conversation

magyta93
Copy link
Contributor

No description provided.

@magyta93 magyta93 requested a review from janosmurai July 31, 2023 18:21
Copy link
Contributor

@janosmurai janosmurai left a 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

Copy link
Contributor

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"])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

from dem.cli.console import stderr
import json, os

def check_is_file(param):
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

def check_is_directory(param):
return(os.path.isdir(param))

def create_exported_dev_env_json(dev_env_name,dev_env_json,given_path):
Copy link
Contributor

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.

Copy link
Contributor Author

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:
Copy link
Contributor

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().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@janosmurai janosmurai merged commit 40ce460 into main Aug 2, 2023
1 check passed
@janosmurai janosmurai deleted the DEM-82 branch August 2, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants