From: W. Trevor King Date: Mon, 28 Dec 2009 15:24:57 +0000 (-0500) Subject: VersionedStorage_commit_TestCase now allows for versioned files created by self.s... X-Git-Tag: 1.0.0~59^2~52^2~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7607146d13233dc4ca6c2ed99889ceb43d7298d0;p=be.git VersionedStorage_commit_TestCase now allows for versioned files created by self.s.init() --- diff --git a/libbe/storage/base.py b/libbe/storage/base.py index 9da60ad..d99c22c 100644 --- a/libbe/storage/base.py +++ b/libbe/storage/base.py @@ -737,11 +737,22 @@ if TESTING == True: class VersionedStorage_commit_TestCase (VersionedStorageTestCase): """Test cases for VersionedStorage methods.""" - id = 'I' #unlikely id' - val = 'X' - commit_msg = 'C' #ommitting something interesting' - commit_body = 'B' #ome\nlonger\ndescription\n' + id = 'unlikely id' + val = 'Some value' + commit_msg = 'Committing something interesting' + commit_body = 'Some\nlonger\ndescription\n' + def _setup_for_empty_commit(self): + """ + Initialization might add some files to version control, so + commit those first, before testing the empty commit + functionality. + """ + try: + self.s.commit('Added initialization files') + except EmptyCommit: + pass + def test_revision_id_exception(self): """ Invalid revision id should raise InvalidRevision. @@ -758,6 +769,7 @@ if TESTING == True: """ Empty commit should raise exception. """ + self._setup_for_empty_commit() try: self.s.commit(self.commit_msg, self.commit_body) self.fail( @@ -770,6 +782,7 @@ if TESTING == True: """ Empty commit should _not_ raise exception if allow_empty=True. """ + self._setup_for_empty_commit() self.s.commit(self.commit_msg, self.commit_body, allow_empty=True)