本文整理汇总了Python中test._common.platform_windows函数的典型用法代码示例。如果您正苦于以下问题:Python platform_windows函数的具体用法?Python platform_windows怎么用?Python platform_windows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了platform_windows函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_distination_windows_removes_both_separators
def test_distination_windows_removes_both_separators(self):
self.i.title = 'one \\ two / three.mp3'
with _common.platform_windows():
p = self.i.destination()
self.assertFalse(b'one \\ two' in p)
self.assertFalse(b'one / two' in p)
self.assertFalse(b'two \\ three' in p)
self.assertFalse(b'two / three' in p)
开发者ID:pprkut,项目名称:beets,代码行数:8,代码来源:test_library.py
示例2: _windows_bytestring_path
def _windows_bytestring_path(self, path):
old_gfse = sys.getfilesystemencoding
sys.getfilesystemencoding = lambda: 'mbcs'
try:
with _common.platform_windows():
return util.bytestring_path(path)
finally:
sys.getfilesystemencoding = old_gfse
开发者ID:JDLH,项目名称:beets,代码行数:8,代码来源:test_util.py
示例3: test_syspath_windows_format_unc_path
def test_syspath_windows_format_unc_path(self):
# The \\?\ prefix on Windows behaves differently with UNC
# (network share) paths.
path = '\\\\server\\share\\file.mp3'
with _common.platform_windows():
outpath = util.syspath(path)
self.assertTrue(isinstance(outpath, six.text_type))
self.assertEqual(outpath, u'\\\\?\\UNC\\server\\share\\file.mp3')
开发者ID:JDLH,项目名称:beets,代码行数:8,代码来源:test_util.py
示例4: test_sanitize_windows_replaces_illegal_chars
def test_sanitize_windows_replaces_illegal_chars(self):
with _common.platform_windows():
p = util.sanitize_path(u':*?"<>|')
self.assertFalse(u':' in p)
self.assertFalse(u'*' in p)
self.assertFalse(u'?' in p)
self.assertFalse(u'"' in p)
self.assertFalse(u'<' in p)
self.assertFalse(u'>' in p)
self.assertFalse(u'|' in p)
开发者ID:JDLH,项目名称:beets,代码行数:10,代码来源:test_util.py
示例5: test_sanitize_windows_replaces_trailing_space
def test_sanitize_windows_replaces_trailing_space(self):
with _common.platform_windows():
p = util.sanitize_path(u'one/two /three')
self.assertFalse(u' ' in p)
开发者ID:JDLH,项目名称:beets,代码行数:4,代码来源:test_util.py
示例6: test_syspath_windows_format
def test_syspath_windows_format(self):
with _common.platform_windows():
path = os.path.join(u'a', u'b', u'c')
outpath = util.syspath(path)
self.assertTrue(isinstance(outpath, six.text_type))
self.assertTrue(outpath.startswith(u'\\\\?\\'))
开发者ID:JDLH,项目名称:beets,代码行数:6,代码来源:test_util.py
注:本文中的test._common.platform_windows函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论