def _do_directory(self, make_name, chdir_name, encoded):
if os.path.isdir(make_name):
os.rmdir(make_name)
os.mkdir(make_name)
try:
with change_cwd(chdir_name):
if not encoded:
cwd_result = os.getcwdu()
name_result = make_name
else:
cwd_result = os.getcwd().decode(TESTFN_ENCODING)
name_result = make_name.decode(TESTFN_ENCODING)
cwd_result = unicodedata.normalize("NFD", cwd_result)
name_result = unicodedata.normalize("NFD", name_result)
self.assertEqual(os.path.basename(cwd_result),name_result)
finally:
os.rmdir(make_name)
# The '_test' functions 'entry points with params' - ie, what the
# top-level 'test' functions would be if they could take params
评论列表
文章目录