]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_encodingutil: fix test_open_representable, which is only valid when run on a...
authordavid-sarah <david-sarah@jacaranda.org>
Sun, 18 Jul 2010 03:03:33 +0000 (20:03 -0700)
committerdavid-sarah <david-sarah@jacaranda.org>
Sun, 18 Jul 2010 03:03:33 +0000 (20:03 -0700)
src/allmydata/test/test_encodingutil.py

index 9a3c5f33058e370c59d83e39d6e6fa37b999ecc7..dd22d0db7a207029e63128cd19b3fdcdbc393918 100644 (file)
@@ -278,8 +278,13 @@ class StdlibUnicode(unittest.TestCase):
         if unicode_platform():
             raise unittest.SkipTest("This test is not applicable to platforms that represent filenames as Unicode.")
 
-        mock.return_value = 'ascii'
-        self.failUnlessRaises(UnicodeEncodeError, open, lumiere_nfc, 'rb')
+        enc = get_filesystem_encoding()
+        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):