-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Do not overwrite identical files #1576
Conversation
If _render_allowed identifies identical source and target, then only returns True if the path refers to a directory, not a file.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
+ Coverage 97.29% 97.33% +0.04%
==========================================
Files 48 48
Lines 4621 4728 +107
==========================================
+ Hits 4496 4602 +106
- Misses 125 126 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Just a test is missing (see #1092 (reply in thread)). Resolves #1092. |
Cool! Do you know how to add the test then? |
I would use the testcase: test_skip_if_exists as an example, and write something along the lines of:
Does it make sense? |
Ok
El lun, 8 abr 2024, 3:17, Andras Gefferth ***@***.***>
escribió:
… Cool! Do you know how to add the test then?
I would use the testcase: test_skip_if_exists
<https://github.com/copier-org/copier/blob/master/tests/test_copy.py#L285>
as an example, and write something along the lines of:
def test_timestamp_identical(tmp_path: Path) -> None:
copier.run_copy(str(Path("tests", "demo_skip_dst")), tmp_path)
modification_time_before = ...
sleep(2)
copier.run_copy(str(Path("tests", "demo_skip_dst")), tmp_path)
modification_time_after = ...
assert modification_time_before == modification_time_after
Does it make sense?
—
Reply to this email directly, view it on GitHub
<#1576 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHNXDLIVFV47LTXYJAHL3TY4H42NAVCNFSM6AAAAABF24WGXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRG42DKNRRHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
test whether identical files are not overwritten, by checking modification timestamp
added missing dependency (sleep)
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.
Just a minor linter error. LGTM otherwise! 🎉
Import order
Head branch was pushed to by a user without write access
If _render_allowed identifies identical source and target, then only returns True if the path refers to a directory, not a file.