Пример #1
0
 def test_skip_first_commit(self, git_repo):
     ts1 = 1589238000
     ts2 = 1589238180
     timestamps = (
         timestamp(ts2, "commit 2"),
         timestamp(ts1, "commit 1"),
     )
     assert get_mtime(timestamps[1:], skip_first_commit=True) is None
     assert get_mtime(timestamps, skip_first_commit=True) == ts2
Пример #2
0
 def test_dirty(self, git_repo):
     ts = 1589238246
     timestamps = (
         timestamp(ts, None),
         timestamp(ts - 60, "commit message"),
         timestamp(ts - 120, "first message"),
     )
     assert get_mtime(timestamps, ignore_commits=r'ignore') == ts
Пример #3
0
 def test_first(self, git_repo):
     ts1 = 1589238000
     ts2 = 1589238180
     timestamps = (
         timestamp(ts2, "commit 2"),
         timestamp(ts1, "commit 1"),
     )
     assert get_mtime(timestamps, strategy='first') == ts1
Пример #4
0
 def test_ignore_commits(self, git_repo):
     ts1 = 1589238000
     ts2 = 1589238180
     timestamps = (
         timestamp(ts2, "[skip] commit 2"),
         timestamp(ts1, "commit 1"),
     )
     assert get_mtime(timestamps, ignore_commits=r'\[skip\]') == ts1
Пример #5
0
 def test_clean(self, git_repo):
     ts = 1589238186
     timestamps = (timestamp(ts, "commit message"), )
     assert get_mtime(timestamps) == ts
Пример #6
0
 def test_not_in_git(self):
     ts = 1589238006
     timestamps = (timestamp(ts, None), )
     assert get_mtime(timestamps) == ts
Пример #7
0
 def test_missing_file(self, git_repo):
     timestamps = ()
     assert get_mtime(timestamps) is None