@@ -27,31 +27,47 @@ def test_bfs_for_latest_version_in_history():
27
27
repo = Repo ()
28
28
expected_version = Version .parse ("1.0.0" )
29
29
v1_commit = Commit (repo , binsha = b"0" * 20 )
30
+
30
31
class TagReferenceOverride (TagReference ):
31
- commit = v1_commit # type: ignore - mocking the commit property
32
+ commit = v1_commit # type: ignore - mocking the commit property
32
33
33
34
v1_tag = TagReferenceOverride (repo , "refs/tags/v1.0.0" , check_path = False )
34
35
35
- trunk = Commit (repo , binsha = b"3" * 20 , parents = [
36
- Commit (repo , binsha = b"2" * 20 , parents = [
37
- Commit (repo , binsha = b"1" * 20 , parents = [v1_commit ]),
38
- ]),
39
- ])
36
+ trunk = Commit (
37
+ repo ,
38
+ binsha = b"3" * 20 ,
39
+ parents = [
40
+ Commit (
41
+ repo ,
42
+ binsha = b"2" * 20 ,
43
+ parents = [
44
+ Commit (repo , binsha = b"1" * 20 , parents = [v1_commit ]),
45
+ ],
46
+ ),
47
+ ],
48
+ )
40
49
start_commit = Commit (
41
50
repo ,
42
51
binsha = b"6" * 20 ,
43
52
parents = [
44
53
trunk ,
45
- Commit (repo , binsha = b"5" * 20 , parents = [
46
- Commit (repo , binsha = b"4" * 20 , parents = [trunk ]),
47
- ]),
48
- ]
54
+ Commit (
55
+ repo ,
56
+ binsha = b"5" * 20 ,
57
+ parents = [
58
+ Commit (repo , binsha = b"4" * 20 , parents = [trunk ]),
59
+ ],
60
+ ),
61
+ ],
49
62
)
50
63
51
64
# Execute
52
- actual = _bfs_for_latest_version_in_history (start_commit , [
53
- (v1_tag , expected_version ),
54
- ])
65
+ actual = _bfs_for_latest_version_in_history (
66
+ start_commit ,
67
+ [
68
+ (v1_tag , expected_version ),
69
+ ],
70
+ )
55
71
56
72
# Verify
57
73
assert expected_version == actual
0 commit comments