def expanduser(filename): """needed because expanduser does not return wide character paths on windows even if a unicode path gets passed. """ if os.name == "nt": profile = windows.get_profile_dir() or u"" if filename == "~": return profile if filename.startswith(u"~" + os.path.sep): return os.path.join(profile, filename[2:]) return os.path.expanduser(filename)
def expanduser(filename): """needed because expanduser does not return wide character paths on windows even if a unicode path gets passed. """ if os.name == "nt": profile = windows.get_profile_dir() or u"" if filename == "~": return profile if filename.startswith(u"~" + os.path.sep): return os.path.join(profile, filename[2:]) return os.path.expanduser(filename)
def test_dir_funcs(self): d = windows.get_personal_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_appdate_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_desktop_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_music_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_profile_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_links_dir() self.assertTrue(d is None or isinstance(d, unicode))
def test_dir_funcs(self): d = windows.get_personal_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_appdate_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_desktop_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_music_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_profile_dir() self.assertTrue(d is None or isinstance(d, unicode)) d = windows.get_links_dir() self.assertTrue(d is None or isinstance(d, unicode))