From: francois Date: Thu, 13 Nov 2008 12:19:51 +0000 (-0700) Subject: test for bug #534, unicode filenames X-Git-Tag: allmydata-tahoe-1.3.0~428 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/flags/quickstart.html?a=commitdiff_plain;h=5c0c5bfc81e1f0cbdb8ecc6195abf009c5630216;p=tahoe-lafs%2Ftahoe-lafs.git test for bug #534, unicode filenames This test assure that uploading a file whose name contains unicode character doesn't prevent further uploads in the same directory. --- diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py index cde59bfb..4fa2e041 100644 --- a/src/allmydata/test/test_cli.py +++ b/src/allmydata/test/test_cli.py @@ -1,3 +1,4 @@ +# coding=utf-8 import os.path from twisted.trial import unittest @@ -544,3 +545,23 @@ class Put(SystemTestMixin, CLITestMixin, unittest.TestCase): self.do_cli("get", "tahoe:uploaded.txt")) d.addCallback(lambda (out,err): self.failUnlessEqual(out, DATA2)) return d + +class Cp(SystemTestMixin, CLITestMixin, unittest.TestCase): + def test_unicode_filename(self): + self.basedir = os.path.dirname(self.mktemp()) + + fn1 = os.path.join(self.basedir, u"Ärtonwall") + open(fn1, "wb").write("unicode file content") + + fn2 = os.path.join(self.basedir, u"Metallica") + open(fn2, "wb").write("non-unicode file content") + + # Bug #534 + # Assure that uploading a file whose name contains unicode character doesn't + # prevent further uploads in the same directory + d = self.set_up_nodes() + d.addCallback(lambda res: self.do_cli("create-alias", "tahoe")) + d.addCallback(lambda res: self.do_cli("cp", fn1, "tahoe:")) + d.addCallback(lambda res: self.do_cli("cp", fn2, "tahoe:")) + + return d