def test_commmit_nomessage(self): transaction.begin() trans = transaction.current() trans.set_blob(['foo'], 'bar'.encode('utf-8')) self.assert_commit_count(0) assert_raises(GitError, transaction.commit) self.assert_commit_count(0) transaction.rollback()
def test_commit(self): transaction.begin() trans = transaction.current() trans.set_blob(['foo'], 'bar'.encode('utf-8')) trans.add_message('foobar') self.assert_commit_count(0) transaction.commit() self.assert_commit_count(1) self.assert_file_exists('foo')
def test_commit_nochanges(self): transaction.begin() self.assert_commit_count(0) assert_raises(GitError, transaction.commit) self.assert_commit_count(0) transaction.rollback()