diff options
author | W. Trevor King <wking@drexel.edu> | 2009-12-28 10:24:57 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-12-28 10:24:57 -0500 |
commit | 7607146d13233dc4ca6c2ed99889ceb43d7298d0 (patch) | |
tree | 865d22f40620b92ad77795a8614ece163fc956ad /libbe | |
parent | e0c58cc0577fbb1b692e051eabd8597ba35c886a (diff) | |
download | bugseverywhere-7607146d13233dc4ca6c2ed99889ceb43d7298d0.tar.gz |
VersionedStorage_commit_TestCase now allows for versioned files created by self.s.init()
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/storage/base.py | 21 |
1 files changed, 17 insertions, 4 deletions
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) |