]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_cli.py: remove invalid 'test_listdir_unicode_bad' test.
authordavid-sarah <david-sarah@jacaranda.org>
Mon, 7 Jun 2010 18:37:30 +0000 (11:37 -0700)
committerdavid-sarah <david-sarah@jacaranda.org>
Mon, 7 Jun 2010 18:37:30 +0000 (11:37 -0700)
src/allmydata/test/test_cli.py

index 453eb50b3aded3f64f8592c19bac79ff2f24cbca..ea1f2f373e2fea59cbacf1191a379037cdf6584e 100644 (file)
@@ -32,7 +32,7 @@ from twisted.python import usage
 from allmydata.util.assertutil import precondition
 from allmydata.util.stringutils import listdir_unicode, open_unicode, unicode_platform, \
     quote_output, get_output_encoding, get_argv_encoding, get_filesystem_encoding, \
-    unicode_to_output, FilenameEncodingError
+    unicode_to_output
 
 timeout = 480 # deep_check takes 360s on Zandr's linksys box, others take > 240s
 
@@ -443,35 +443,6 @@ class CLI(CLITestMixin, unittest.TestCase):
         for file in listdir_unicode(unicode(basedir)):
             self.failUnlessIn(file, filenames)
 
-    def test_listdir_unicode_bad(self):
-        basedir = "cli/common/listdir_unicode_bad"
-        fileutil.make_dirs(basedir)
-
-        filenames = [name.encode('latin1') for name in [u'Lôzane', u'Bern', u'Genève']]
-        enc = get_filesystem_encoding()
-        def is_decodable(u):
-            try:
-                u.decode(enc)
-                return True
-            except UnicodeDecodeError:
-                return False
-
-        if all(map(is_decodable, filenames)):
-            raise unittest.SkipTest("To perform this test, we must know a filename that is "
-                                    "not decodable in the platform's filesystem encoding.")
-
-        try:
-            for name in filenames:
-                path = os.path.join(basedir, name)
-                open(path, "wb").close()
-        except EnvironmentError:
-            # Maybe the OS or Python wouldn't let us create a file at the badly encoded path,
-            # which is entirely reasonable.
-            raise unittest.SkipTest("This test is only applicable to platforms that allow "
-                                    "creating files at badly encoded paths.")
-
-        self.failUnlessRaises(FilenameEncodingError, listdir_unicode, unicode(basedir))
-
 
 class Help(unittest.TestCase):