提交 639ae27c 编写于 作者: C Cleber Rosa

Test: turn basedir into a property

Since basedir is closely related to `filename` and `datadir`, let's
also make it a property for coherency.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 c6b6ad96
......@@ -88,8 +88,6 @@ class Test(unittest.TestCase):
self.job = job
self.basedir = os.path.dirname(self.filename)
if self.datadir is None:
self._expected_stdout_file = None
self._expected_stderr_file = None
......@@ -162,6 +160,16 @@ class Test(unittest.TestCase):
self.time_elapsed = None
unittest.TestCase.__init__(self, methodName=methodName)
@property
def basedir(self):
"""
The directory where this test (when backed by a file) is located at
"""
if self.filename is not None:
return os.path.dirname(self.filename)
else:
return None
@property
def datadir(self):
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册