':type path: str
:type module_path: str | None
:type module_prefix: str | None
:type base_path: str'

def __init__(self, path, module_path, module_prefix, base_path):

    super(TestTarget, self).__init__()
    self.name = path
    self.path = path
    self.base_path = ((base_path + '/') if base_path else None)
    (name, ext) = os.path.splitext(os.path.basename(self.path))
    if (module_path and path.startswith(module_path) and (name != '__init__') and (ext in MODULE_EXTENSIONS)):
        self.module = name[len((module_prefix or '')):].lstrip('_')
        self.modules = (self.module,)
    else:
        self.module = None
        self.modules = tuple()
    aliases = [self.path, self.module]
    parts = self.path.split('/')
    for i in range(1, len(parts)):
        alias = ('%s/' % '/'.join(parts[:i]))
        aliases.append(alias)
    aliases = [a for a in aliases if a]
    self.aliases = tuple(sorted(aliases))
