test_encodingutil: fix test_open_representable, which is only valid when run on a platform for which we know an unrepresentable filename.
This commit is contained in:
parent
968edfda11
commit
bdb10553eb
|
@ -278,8 +278,13 @@ class StdlibUnicode(unittest.TestCase):
|
||||||
if unicode_platform():
|
if unicode_platform():
|
||||||
raise unittest.SkipTest("This test is not applicable to platforms that represent filenames as Unicode.")
|
raise unittest.SkipTest("This test is not applicable to platforms that represent filenames as Unicode.")
|
||||||
|
|
||||||
mock.return_value = 'ascii'
|
enc = get_filesystem_encoding()
|
||||||
self.failUnlessRaises(UnicodeEncodeError, open, lumiere_nfc, 'rb')
|
fn = u'\u2621.txt'
|
||||||
|
try:
|
||||||
|
fn.encode(enc)
|
||||||
|
raise unittest.SkipTest("This test cannot be run unless we know a filename that is not representable.")
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
self.failUnlessRaises(UnicodeEncodeError, open, fn, 'wb')
|
||||||
|
|
||||||
|
|
||||||
class UbuntuKarmicUTF8(EncodingUtil, unittest.TestCase):
|
class UbuntuKarmicUTF8(EncodingUtil, unittest.TestCase):
|
||||||
|
|
Loading…
Reference in New Issue