summaryrefslogtreecommitdiff
path: root/cmdtestlib.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-02-09 22:44:36 +0000
committerLars Wirzenius <liw@liw.fi>2012-02-09 22:44:36 +0000
commit3ae8ac5595c1f9020d32fee989ce354d58723d51 (patch)
tree14bccfb75aa39d2b1120736cafc68b75ed98d12d /cmdtestlib.py
parent1a62be25fbffd09d1cf1797c4a65e376f37a2156 (diff)
downloadcmdtest-3ae8ac5595c1f9020d32fee989ce354d58723d51.tar.gz
Fix checking for whether files exist
The previous code would check whether a file exists, but we need it to check whether the file is in the list of files given. This is important for unit tests to work.
Diffstat (limited to 'cmdtestlib.py')
-rw-r--r--cmdtestlib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmdtestlib.py b/cmdtestlib.py
index a064cbc..8c63d37 100644
--- a/cmdtestlib.py
+++ b/cmdtestlib.py
@@ -46,8 +46,8 @@ class TestDir(object):
script_names = ['setup_once', 'setup', 'teardown', 'teardown_once']
for name in script_names:
- full_path = os.path.join(dirname, name)
- if os.path.exists(full_path):
+ if name in filenames:
+ full_path = os.path.join(dirname, name)
setattr(self, name, full_path)
prefixes = self.find_prefixes(filenames)