Commit 210e847c authored by Peter Hutterer's avatar Peter Hutterer
Browse files

ci-fairy tests: don't commit until we've flushed the file



Didn't matter in the past because we didn't do anything with the files but
it is confusing nonetheless - if the file isn't flushed our commit is an
empty file.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 42ba0fa2
......@@ -850,16 +850,16 @@ def test_commits_msgformat(caplog, gitlab_default_env):
with open('test', 'w') as fd:
fd.write('foo')
repo.index.add(['test'])
repo.index.commit('initial commit')
repo.index.add(['test'])
repo.index.commit('initial commit')
b = repo.create_head('mybranch')
repo.head.reference = b
with open('test', 'w') as fd:
fd.write('bar')
repo.index.add(['test'])
# second line must be empty
repo.index.commit('three\nline\ncommit')
repo.index.add(['test'])
# second line must be empty
repo.index.commit('three\nline\ncommit')
result = runner.invoke(ci_fairy.ci_fairy, args)
assert result.exit_code == 1
......@@ -872,8 +872,8 @@ def test_commits_msgformat(caplog, gitlab_default_env):
assert result.exit_code == 0
with open('test', 'w') as fd:
fd.write('bar')
repo.index.add(['test'])
repo.index.commit('too long a line' * 10)
repo.index.add(['test'])
repo.index.commit('too long a line' * 10)
result = runner.invoke(ci_fairy.ci_fairy, args)
assert result.exit_code == 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment