summaryrefslogtreecommitdiff
path: root/test/test_testing.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-03-22 07:58:28 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-03-22 07:58:28 -0400
commit67a56e01aab739c49db65318a271c4c91f8db294 (patch)
tree311055772848bd4bee3b0849ec57d1be1c456342 /test/test_testing.py
parent43167860f5d36940bd56b0a55d4694ab27fff182 (diff)
downloadpython-coveragepy-67a56e01aab739c49db65318a271c4c91f8db294.tar.gz
Add a test helper for checking on the existence of files.
Diffstat (limited to 'test/test_testing.py')
-rw-r--r--test/test_testing.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_testing.py b/test/test_testing.py
index 2461a08..bcf7d28 100644
--- a/test/test_testing.py
+++ b/test/test_testing.py
@@ -121,3 +121,12 @@ class CoverageTestTest(CoverageTest):
self.assertEqual(self.file_text("dos.txt"), "Hello\r\n")
self.make_file("mac.txt", "Hello\n", newline="\r")
self.assertEqual(self.file_text("mac.txt"), "Hello\r")
+
+ def test_file_exists(self):
+ self.make_file("whoville.txt", "We are here!")
+ self.assert_exists("whoville.txt")
+ self.assert_doesnt_exist("shadow.txt")
+ self.assertRaises(AssertionError, self.assert_doesnt_exist,
+ "whoville.txt")
+ self.assertRaises(AssertionError, self.assert_exists, "shadow.txt")
+