def check_construct_modulepath(filepath, modulepath): rootpath = os.path.join(VALID_ABSPATH, 'root') abspath = os.path.join(rootpath, filepath) made = ImportFileMagic._construct_modulepath(abspath, rootpath) eq_(made, modulepath)