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
commit1f950ca6c4c1da6d5f2f37faeb0217e9ff273b75 (patch)
tree46f489f147b0319d7966344d46199464872c3287 /test/test_testing.py
parent8cb2411f3ed6db02f7a7dd60883c8dd698b5a69f (diff)
downloadpython-coveragepy-git-1f950ca6c4c1da6d5f2f37faeb0217e9ff273b75.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 2461a08e..bcf7d281 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")
+