diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-03-22 07:58:28 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-03-22 07:58:28 -0400 |
commit | 1f950ca6c4c1da6d5f2f37faeb0217e9ff273b75 (patch) | |
tree | 46f489f147b0319d7966344d46199464872c3287 /test/coveragetest.py | |
parent | 8cb2411f3ed6db02f7a7dd60883c8dd698b5a69f (diff) | |
download | python-coveragepy-git-1f950ca6c4c1da6d5f2f37faeb0217e9ff273b75.tar.gz |
Add a test helper for checking on the existence of files.
Diffstat (limited to 'test/coveragetest.py')
-rw-r--r-- | test/coveragetest.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/coveragetest.py b/test/coveragetest.py index 8c05f32f..621d7ae2 100644 --- a/test/coveragetest.py +++ b/test/coveragetest.py @@ -340,6 +340,16 @@ class CoverageTest(TestCase): flist2_nice = [self.nice_file(f) for f in flist2] self.assertSameElements(flist1_nice, flist2_nice) + def assert_exists(self, fname): + """Assert that `fname` is a file that exists.""" + msg = "File %r should exist" % fname + self.assert_(os.path.exists(fname), msg) + + def assert_doesnt_exist(self, fname): + """Assert that `fname` is a file that doesn't exist.""" + msg = "File %r shouldn't exist" % fname + self.assert_(not os.path.exists(fname), msg) + def command_line(self, args, ret=OK, _covpkg=None): """Run `args` through the command line. |