@@ -70,7 +70,7 @@ def test_get_commits_author_and_email():
70
70
create_file_and_commit ("fix: username exception" )
71
71
commit = git .get_commits ()[0 ]
72
72
73
- assert commit .author is not ""
73
+ assert commit .author != ""
74
74
assert "@" in commit .author_email
75
75
76
76
@@ -176,12 +176,30 @@ def test_get_latest_tag_name(tmp_commitizen_project):
176
176
assert tag_name == "1.0"
177
177
178
178
179
- def test_is_staging_clean (tmp_commitizen_project ):
179
+ def test_is_staging_clean_when_adding_file (tmp_commitizen_project ):
180
+ with tmp_commitizen_project .as_cwd ():
181
+ assert git .is_staging_clean () is True
182
+
183
+ cmd .run ("touch test_file" )
184
+
185
+ assert git .is_staging_clean () is True
186
+
187
+ cmd .run ("git add test_file" )
188
+
189
+ assert git .is_staging_clean () is False
190
+
191
+
192
+ def test_is_staging_clean_when_updating_file (tmp_commitizen_project ):
180
193
with tmp_commitizen_project .as_cwd ():
181
194
assert git .is_staging_clean () is True
182
195
183
196
cmd .run ("touch test_file" )
184
197
cmd .run ("git add test_file" )
198
+ cmd .run ("git commit -m 'add test_file'" )
185
199
cmd .run ("echo 'test' > test_file" )
186
200
201
+ assert git .is_staging_clean () is True
202
+
203
+ cmd .run ("git add test_file" )
204
+
187
205
assert git .is_staging_clean () is False
0 commit comments