@@ -155,6 +155,16 @@ def setup_commit_history(testproject_path):
155
155
repo .git .add ("docs/page_with_tag.md" )
156
156
repo .git .commit (message = "update homepage" , author = author , date = "1642911026" ) # Sun Jan 23 2022 04:10:26 GMT+0000
157
157
158
+ bf_file_name = os .path .join (testproject_path , "docs/page_with_renamed.md" )
159
+ af_file_name = os .path .join (testproject_path , "docs/subfolder/page_with_renamed.md" )
160
+ # Since git.mv would actually remove the file, move page_with_renamed.md back to docs if it has been moved
161
+ if os .path .exists (af_file_name ):
162
+ os .replace (af_file_name , bf_file_name )
163
+ repo .git .add ("docs/page_with_renamed.md" )
164
+ repo .git .commit (message = "page_with_renamed.md before renamed" , author = author , date = "1655229469" ) # Tue Jun 14 2022 17:57:49 GMT+0000
165
+ repo .git .mv ("docs/page_with_renamed.md" , "docs/subfolder/page_with_renamed.md" )
166
+ repo .git .commit (message = "page_with_renamed.md after renamed" , author = author , date = "1655229515" ) # Tue Jun 14 2022 17:58:35 GMT+0000
167
+
158
168
repo .git .add ("docs/first_page.md" )
159
169
repo .git .commit (message = "first page" , author = author , date = "1500854705" ) # Mon Jul 24 2017 00:05:05 GMT+0000
160
170
file_name = os .path .join (testproject_path , "docs/first_page.md" )
@@ -254,6 +264,11 @@ def validate_build(testproject_path, plugin_config: dict = {}):
254
264
searches = [x in contents for x in date_formats .values ()]
255
265
assert any (searches ), "No correct creation date formats output was found"
256
266
267
+ commit_timestamp = repo .get_git_commit_timestamp (
268
+ path = str (testproject_path / "docs/subfolder/page_with_renamed.md" ),
269
+ is_first_commit = True
270
+ )
271
+ assert commit_timestamp == 1655229469
257
272
258
273
def validate_mkdocs_file (temp_path : str , mkdocs_yml_file : str ):
259
274
"""
@@ -355,10 +370,10 @@ def test_tags_are_replaced(tmp_path, mkdocs_file):
355
370
pytest .skip ("Not necessary to test the JS library" )
356
371
357
372
# Make sure count_commits() works
358
- # We created 8 commits in setup_commit_history()
373
+ # We created 10 commits in setup_commit_history()
359
374
with working_directory (testproject_path ):
360
375
u = Util ()
361
- assert commit_count (u ._get_repo ("docs/page_with_tag.md" )) == 8
376
+ assert commit_count (u ._get_repo ("docs/page_with_tag.md" )) == 10
362
377
363
378
364
379
# the revision date was in 'setup_commit_history' was set to 1642911026 (Sun Jan 23 2022 04:10:26 GMT+0000)
0 commit comments