提交 c6b6ad96 编写于 作者: C Cleber Rosa

Test: turn filename into a property

It now becomes a first class citizen, with proper documentation.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 2852f2b2
......@@ -88,7 +88,6 @@ class Test(unittest.TestCase):
self.job = job
self.filename = inspect.getfile(self.__class__).rstrip('co')
self.basedir = os.path.dirname(self.filename)
if self.datadir is None:
......@@ -168,8 +167,14 @@ class Test(unittest.TestCase):
"""
Returns the path to the directory that contains test data files
"""
filename = inspect.getfile(self.__class__).rstrip('co')
return filename + '.data'
return self.filename + '.data'
@property
def filename(self):
"""
Returns the name of the file (path) that holds the current test
"""
return inspect.getfile(self.__class__).rstrip('co')
@data_structures.LazyProperty
def workdir(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册