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

test: Add tests for cli.py #799

Closed
wants to merge 9 commits into from

Conversation

Mr-Sunglasses
Copy link
Contributor

Description

This PR fixes #635

Copy link

vercel bot commented Apr 17, 2024

@Mr-Sunglasses is attempting to deploy a commit to the sparckles Team on Vercel.

A member of the Team first needs to authorize it.

@Mr-Sunglasses
Copy link
Contributor Author

Mr-Sunglasses commented Apr 17, 2024

Description

This PR fixes #635

Hey 👋🏻 @sansyrox , back again to Robyn after a long time, Looking forward to picking up more issues 🥂

Copy link

codspeed-hq bot commented Apr 18, 2024

CodSpeed Performance Report

Merging #799 will not alter performance

Comparing Mr-Sunglasses:fix/635 (9986f5a) with main (37e57b9)

Summary

✅ 108 untouched benchmarks

unit_tests/test_cli.py Outdated Show resolved Hide resolved
unit_tests/test_cli.py Outdated Show resolved Hide resolved
Copy link
Member

@sansyrox sansyrox left a comment

Choose a reason for hiding this comment

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

Hey @Mr-Sunglasses 👋

Welcome back! Great work. I have some suggestions.

Do let me know if you have any questions 😄

@sansyrox
Copy link
Member

Also, the CI is failing. Do have a look at that too 😄

@Mr-Sunglasses Mr-Sunglasses changed the title tests: Add tests for cli.py test: Add tests for cli.py Apr 18, 2024

@pytest.fixture
def project_directory():
return CURRENT_WORKING_DIR / "test_dir"
Copy link
Member

Choose a reason for hiding this comment

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

Hey @Mr-Sunglasses 👋

The windows tests are failing due to this path joining. Try doing Path.resolve here

expected_template_path = (SCAFFOLD_DIR / project_type).resolve()
mock_copytree.assert_called_with(str(expected_template_path), str(expected_project_dir), dirs_exist_ok=True)
if should_remove_dockerfile:
expected_dockerfile_path = os.path.join(expected_project_dir, "Dockerfile")
Copy link
Member

Choose a reason for hiding this comment

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

mock_copytree.assert_called_with(str(expected_template_path), str(expected_project_dir), dirs_exist_ok=True)
if should_remove_dockerfile:
expected_dockerfile_path = os.path.join(expected_project_dir, "Dockerfile")
mock_remove.assert_called_once_with(expected_dockerfile_path)
Copy link
Member

Choose a reason for hiding this comment

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

this should fix the error here

@Mr-Sunglasses
Copy link
Contributor Author

Hey 👋🏻 @sansyrox , I think I need to revisit the cli.py implementation and check weather it is working in windows or not as using pathlib does not resolve this issue in actions 😢 .

@sansyrox sansyrox closed this Aug 25, 2024
@sansyrox
Copy link
Member

Hey @Mr-Sunglasses , closing this as the tests have been implemented now.

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.

add tests for the cli(__main__.py)
2 participants