-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added first unit test for pyprojen #1
Conversation
…snapshot` function. Adding global import caused circular import problem which needs to fixed, local import is used as a workaround.
…ting; and added an empty text file generation test
…ted the `actions/setup-python` version to v5 and `actions/checkout` to v4
def test_project() -> Generator[Project, Any, None]: | ||
"""Create a temporary project for testing.""" | ||
# Setup: Create a TestProject instance with a temporary directory | ||
outdir = tempfile.mkdtemp() |
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.
Genius. So cool that this works.
TextFile(scope=test_project, file_path=TEST_FILE_PATH, lines=["line 1", "line 2", "line 3"]) | ||
|
||
# THEN: Take a snapshot of the project and check the file content | ||
output: dict = synth_snapshot(test_project) |
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 synth_snapshot
function in action!
So great! The fact that we have an established testing framework now, and that it passes in CI is a huge step forward! |
Changes:
pyproject.toml
filesrc/pyprojen/cleanup.py
JsonFile
frompyprojen.json_file
insynth_snapshot
function. Adding global import caused a circular import problem, which needs to be fixed; local import is used as a workaround.match case
we used in the resolve filepyprojen/src/pyprojen/_resolve.py
projen
repo