glob: Patch test_glob.py a bit.

bytes/str dichotomy and win32-specifics.
pull/118/head
Paul Sokolovsky 2014-05-19 23:54:03 +03:00
rodzic 3409396c10
commit 6e4d7ee145
1 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -1,5 +1,6 @@
import glob
import os
import os.path
import shutil
import sys
import unittest
@ -69,10 +70,10 @@ class GlobTests(unittest.TestCase):
res = glob.glob(os.path.join(os.curdir, '*'))
self.assertEqual({type(r) for r in res}, {str})
res = glob.glob(b'*')
self.assertEqual({type(r) for r in res}, {bytes})
res = glob.glob(os.path.join(os.fsencode(os.curdir), b'*'))
self.assertEqual({type(r) for r in res}, {bytes})
# res = glob.glob(b'*')
# self.assertEqual({type(r) for r in res}, {bytes})
# res = glob.glob(os.path.join(os.fsencode(os.curdir), b'*'))
# self.assertEqual({type(r) for r in res}, {bytes})
def test_glob_one_directory(self):
eq = self.assertSequencesEqual_noorder
@ -157,8 +158,8 @@ class GlobTests(unittest.TestCase):
eq(self.glob('sym1'), [self.norm('sym1')])
eq(self.glob('sym2'), [self.norm('sym2')])
@unittest.skipUnless(sys.platform == "win32", "Win32 specific test")
def test_glob_magic_in_drive(self):
# @unittest.skipUnless(sys.platform == "win32", "Win32 specific test")
def _test_glob_magic_in_drive(self):
eq = self.assertSequencesEqual_noorder
eq(glob.glob('*:'), [])
eq(glob.glob(b'*:'), [])