tests: Avoid hidden logic with better .assert*() method choices

We'll get better failure messages if we use an assertion method that
understands the comparison we're trying to make.  If you make the
comparison by hand and assertTrue(), you don't get much constructive
feedback ;).
This commit is contained in:
W. Trevor King 2013-06-12 14:52:23 -04:00
commit 5a61600bc9
3 changed files with 6 additions and 6 deletions

View file

@ -186,7 +186,7 @@ class TestUtils(LoggedTestCase):
test_directory = os.path.join(os.path.dirname(__file__),
'does_not_exist')
utils.clean_output_dir(test_directory)
self.assertTrue(not os.path.exists(test_directory))
self.assertFalse(os.path.exists(test_directory))
def test_clean_output_dir_is_file(self):
test_directory = os.path.join(os.path.dirname(__file__),
@ -195,7 +195,7 @@ class TestUtils(LoggedTestCase):
f.write('')
f.close()
utils.clean_output_dir(test_directory)
self.assertTrue(not os.path.exists(test_directory))
self.assertFalse(os.path.exists(test_directory))
def test_strftime(self):
d = datetime.date(2012, 8, 29)