@@ -35,7 +35,7 @@ def test_no_tags(self):
3535 with self .assertRaises (ValueError ):
3636 query_git_repo (self .repo_path )
3737 version = predict_git_repo (self .repo_path )
38- self .assertEqual (version .to_str (), f'0.1.0.dev{ i } +{ self .repo_head_hexsha } ' )
38+ self .assertEqual (version .to_str (), f'0.1.0.dev{ i } +git { self .repo_head_hexsha } ' )
3939
4040 def test_only_nonversion_tags (self ):
4141 for i in range (1 , 5 ):
@@ -44,7 +44,7 @@ def test_only_nonversion_tags(self):
4444 with self .assertRaises (ValueError ):
4545 query_git_repo (self .repo_path )
4646 version = predict_git_repo (self .repo_path )
47- self .assertEqual (version .to_str (), f'0.1.0.dev{ i } +{ self .repo_head_hexsha } ' )
47+ self .assertEqual (version .to_str (), f'0.1.0.dev{ i } +git { self .repo_head_hexsha } ' )
4848
4949 def test_inconsistent_tag_prefix (self ):
5050 version = Version .from_str ('1.0' )
@@ -70,7 +70,7 @@ def test_nonversion_tags(self):
7070 upcoming_version = predict_git_repo (self .repo_path )
7171 version .increment (VersionComponent .Patch , 1 )
7272 version .increment (VersionComponent .DevPatch , 2 )
73- version .local = (self .repo_head_hexsha ,)
73+ version .local = (f'git { self .repo_head_hexsha } ' ,)
7474 self .assertEqual (version , upcoming_version )
7575
7676 def test_too_long_no_tag (self ):
@@ -103,7 +103,7 @@ def test_nonversion_merged_branches(self):
103103 with self .assertRaises (ValueError ):
104104 query_git_repo (self .repo_path )
105105 upcoming_version = predict_git_repo (self .repo_path )
106- self .assertEqual (upcoming_version .to_str (), f'0.1.0.dev6+{ self .repo_head_hexsha } ' )
106+ self .assertEqual (upcoming_version .to_str (), f'0.1.0.dev6+git { self .repo_head_hexsha } ' )
107107
108108 def test_invalid_version_tags (self ):
109109 for i in range (1 , 3 ):
@@ -116,7 +116,7 @@ def test_invalid_version_tags(self):
116116 self .assertEqual (current_version .to_str (), f'{ i } .0.0' )
117117 upcoming_version = predict_git_repo (self .repo_path )
118118 current_version .devel_increment (1 )
119- current_version .local = (self .repo_head_hexsha ,)
119+ current_version .local = (f'git { self .repo_head_hexsha } ' ,)
120120 self .assertEqual (current_version , upcoming_version )
121121
122122 def test_dirty_repo (self ):
@@ -133,9 +133,9 @@ def test_dirty_repo(self):
133133 self .assertLess (version , upcoming_version )
134134 if new_commit :
135135 current_version .devel_increment (1 )
136- current_version .local = (self .repo_head_hexsha ,)
136+ current_version .local = (f'git { self .repo_head_hexsha } ' ,)
137137 self .assertTupleEqual (current_version .local , upcoming_version .local [:1 ])
138- local_prefix = f'+{ self .repo_head_hexsha } .dirty'
138+ local_prefix = f'+git { self .repo_head_hexsha } .dirty'
139139 else :
140140 local_prefix = '+dirty'
141141 self .assertTrue (upcoming_version .local_to_str ().startswith (local_prefix ),
@@ -157,12 +157,12 @@ def test_nonlatest_commit(self):
157157 current_version = query_git_repo (self .repo_path )
158158 self .assertEqual (current_version .to_str (), '0.1.0' )
159159 upcoming_version = predict_git_repo (self .repo_path )
160- self .assertEqual (upcoming_version .to_str (), f'0.1.1.dev1+{ self .repo_head_hexsha } ' )
160+ self .assertEqual (upcoming_version .to_str (), f'0.1.1.dev1+git { self .repo_head_hexsha } ' )
161161 self .repo .git .checkout ('devel' )
162162 current_version = query_git_repo (self .repo_path )
163163 self .assertEqual (current_version .to_str (), '0.2.0' )
164164 upcoming_version = predict_git_repo (self .repo_path )
165- self .assertEqual (upcoming_version .to_str (), f'0.2.1.dev1+{ self .repo_head_hexsha } ' )
165+ self .assertEqual (upcoming_version .to_str (), f'0.2.1.dev1+git { self .repo_head_hexsha } ' )
166166
167167 def test_tags_on_merged_branches (self ):
168168 self .git_commit_new_file ()
@@ -182,7 +182,7 @@ def test_tags_on_merged_branches(self):
182182 current_version = query_git_repo (self .repo_path )
183183 self .assertEqual (current_version .to_str (), '0.2.0' )
184184 upcoming_version = predict_git_repo (self .repo_path )
185- self .assertEqual (upcoming_version .to_str (), f'0.2.1.dev5+{ self .repo_head_hexsha } ' )
185+ self .assertEqual (upcoming_version .to_str (), f'0.2.1.dev5+git { self .repo_head_hexsha } ' )
186186
187187 def test_tag_on_merged_branch (self ):
188188 self .git_commit_new_file ()
@@ -196,7 +196,7 @@ def test_tag_on_merged_branch(self):
196196 current_version = query_git_repo (self .repo_path )
197197 self .assertEqual (current_version .to_str (), '1.0.0' )
198198 upcoming_version = predict_git_repo (self .repo_path )
199- self .assertEqual (upcoming_version .to_str (), f'1.0.1.dev1+{ self .repo_head_hexsha } ' )
199+ self .assertEqual (upcoming_version .to_str (), f'1.0.1.dev1+git { self .repo_head_hexsha } ' )
200200
201201 def test_many_versions_on_one_commit (self ):
202202 self .git_commit_new_file ()
@@ -207,7 +207,7 @@ def test_many_versions_on_one_commit(self):
207207 current_version = query_git_repo (self .repo_path )
208208 self .assertEqual (current_version .to_str (), '0.3.0' )
209209 upcoming_version = predict_git_repo (self .repo_path )
210- self .assertEqual (upcoming_version .to_str (), f'0.3.1.dev1+{ self .repo_head_hexsha } ' )
210+ self .assertEqual (upcoming_version .to_str (), f'0.3.1.dev1+git { self .repo_head_hexsha } ' )
211211
212212 def test_version_decreased (self ):
213213 self .git_commit_new_file ()
@@ -218,4 +218,4 @@ def test_version_decreased(self):
218218 current_version = query_git_repo (self .repo_path )
219219 self .assertEqual (current_version .to_str (), '0.1.0' )
220220 upcoming_version = predict_git_repo (self .repo_path )
221- self .assertEqual (upcoming_version .to_str (), f'0.1.1.dev1+{ self .repo_head_hexsha } ' )
221+ self .assertEqual (upcoming_version .to_str (), f'0.1.1.dev1+git { self .repo_head_hexsha } ' )
0 commit comments