diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-09-28 18:38:52 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-09-28 21:59:11 +0300 |
commit | 4cdfe6d31b0191c3e4f2ebb9f080c54a5a7cee91 (patch) | |
tree | d1577dc2bc3ca1f03914088924b3a85819000851 | |
parent | faa7d1c006dfc890a537aa5b71ee9bbf8eea4fe5 (diff) | |
download | obnam-4cdfe6d31b0191c3e4f2ebb9f080c54a5a7cee91.tar.gz |
Avoid using assertTrue(True) in unit test
-rw-r--r-- | obnamlib/lockmgr_tests.py | 2 | ||||
-rw-r--r-- | obnamlib/obnamerror.py | 4 | ||||
-rw-r--r-- | obnamlib/repo_interface.py | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/obnamlib/lockmgr_tests.py b/obnamlib/lockmgr_tests.py index 06bee1a2..c6dd6d39 100644 --- a/obnamlib/lockmgr_tests.py +++ b/obnamlib/lockmgr_tests.py @@ -75,7 +75,7 @@ class LockManagerTests(unittest.TestCase): self.lm._sleep = lambda: os.remove( self.lm.get_lock_name(self.dirnames[0])) self.lm.lock([self.dirnames[0]]) - self.assertTrue(True) + self.assertTrue(self.lm.is_locked(self.dirnames[0])) def test_locks_all_directories(self): self.lm.lock(self.dirnames) diff --git a/obnamlib/obnamerror.py b/obnamlib/obnamerror.py index 360ba2a2..d639cb15 100644 --- a/obnamlib/obnamerror.py +++ b/obnamlib/obnamerror.py @@ -16,11 +16,11 @@ # =*= License: GPL-3+ =*= -import structurederror +from .structurederror import StructuredError # Base exception for all Obnam specific exceptions. -class ObnamError(structurederror.StructuredError): +class ObnamError(StructuredError): pass diff --git a/obnamlib/repo_interface.py b/obnamlib/repo_interface.py index 361c33c9..0077b6df 100644 --- a/obnamlib/repo_interface.py +++ b/obnamlib/repo_interface.py @@ -991,8 +991,7 @@ class RepositoryInterfaceTests(unittest.TestCase): # pragma: no cover def test_closes_repository(self): # Can't think of a test to verify the closing happened, # so just calling the method will have to do for now. - self.repo.close() - self.assertTrue(True) + self.assertEqual(self.repo.close(), None) def test_returns_list_of_shared_directories(self): self.assertTrue(type(self.repo.get_shared_directories()), list) |