def __init__(self, name, bases, classdict):
type.__init__(self, name, bases, classdict)
spd_file = classdict.get('SPD_FILE', None)
if spd_file:
# Get the module that contains the test case class. This allows us
# to find the SPD file relative to its location.
module = inspect.getmodule(self)
module_path = os.path.dirname(module.__file__)
spd_path = os.path.normpath(os.path.join(module_path, spd_file))
# Parse the SPD to get the implementation IDs.
spd = SPDParser.parse(spd_path)
self.__impls__ = [impl.get_id() for impl in spd.get_implementation()]
# Update the path to the SPD file.
self.spd_file = spd_path
else:
self.spd_file = None
self.__impls__ = ()
评论列表
文章目录