Rev 3482: (jam) Move bzrlib.tests.test_diff.UnicodeFilename into in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Jun 6 14:56:36 BST 2008
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3482
revision-id:pqm at pqm.ubuntu.com-20080606135624-1ambbf8pct52xfh8
parent: pqm at pqm.ubuntu.com-20080606122916-jpq5b5yt1bv9hvsz
parent: john at arbash-meinel.com-20080606133030-9cnvpyem4mnplg8k
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-06-06 14:56:24 +0100
message:
(jam) Move bzrlib.tests.test_diff.UnicodeFilename into
bzrlib.tests.UnicodeFilenameFeature
modified:
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/test_diff.py testdiff.py-20050727164403-d1a3496ebb12e339
bzrlib/tests/test_msgeditor.py test_msgeditor.py-20051202041359-920315ec6011ee51
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
------------------------------------------------------------
revno: 3477.1.2
revision-id:john at arbash-meinel.com-20080606133030-9cnvpyem4mnplg8k
parent: john at arbash-meinel.com-20080605210642-zoc3nelx84xmsxuf
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Fri 2008-06-06 08:30:30 -0500
message:
Rename UnicodeFilename => UnicodeFilenameFeature
modified:
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/test_diff.py testdiff.py-20050727164403-d1a3496ebb12e339
bzrlib/tests/test_msgeditor.py test_msgeditor.py-20051202041359-920315ec6011ee51
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
------------------------------------------------------------
revno: 3477.1.1
revision-id:john at arbash-meinel.com-20080605210642-zoc3nelx84xmsxuf
parent: pqm at pqm.ubuntu.com-20080605191237-2306x0goo9pfh9to
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: symlink_unicode_135320
timestamp: Thu 2008-06-05 16:06:42 -0500
message:
Move UnicodeFeature into a core 'tests' feature, rather than living in test_diff.
modified:
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/test_diff.py testdiff.py-20050727164403-d1a3496ebb12e339
bzrlib/tests/test_msgeditor.py test_msgeditor.py-20051202041359-920315ec6011ee51
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2008-06-06 08:44:12 +0000
+++ b/bzrlib/tests/__init__.py 2008-06-06 13:56:24 +0000
@@ -3063,6 +3063,26 @@
OsFifoFeature = _OsFifoFeature()
+class _UnicodeFilenameFeature(Feature):
+ """Does the filesystem support Unicode filenames?"""
+
+ def _probe(self):
+ try:
+ os.stat(u'\u03b1')
+ except UnicodeEncodeError:
+ return False
+ except (IOError, OSError):
+ # The filesystem allows the Unicode filename but the file doesn't
+ # exist.
+ return True
+ else:
+ # The filesystem allows the Unicode filename and the file exists,
+ # for some reason.
+ return True
+
+UnicodeFilenameFeature = _UnicodeFilenameFeature()
+
+
class TestScenarioApplier(object):
"""A tool to apply scenarios to tests."""
=== modified file 'bzrlib/tests/test_diff.py'
--- a/bzrlib/tests/test_diff.py 2008-03-13 23:22:12 +0000
+++ b/bzrlib/tests/test_diff.py 2008-06-06 13:30:30 +0000
@@ -56,35 +56,6 @@
CompiledPatienceDiffFeature = _CompiledPatienceDiffFeature()
-class _UnicodeFilename(Feature):
- """Does the filesystem support Unicode filenames?"""
-
- def _probe(self):
- try:
- os.stat(u'\u03b1')
- except UnicodeEncodeError:
- return False
- except (IOError, OSError):
- # The filesystem allows the Unicode filename but the file doesn't
- # exist.
- return True
- else:
- # The filesystem allows the Unicode filename and the file exists,
- # for some reason.
- return True
-
-UnicodeFilename = _UnicodeFilename()
-
-
-class TestUnicodeFilename(TestCase):
-
- def test_probe_passes(self):
- """UnicodeFilename._probe passes."""
- # We can't test much more than that because the behaviour depends
- # on the platform.
- UnicodeFilename._probe()
-
-
def udiff_lines(old, new, allow_binary=False):
output = StringIO()
internal_diff('old', old, 'new', new, output, allow_binary)
@@ -548,7 +519,7 @@
is a binary file in the diff.
"""
# See https://bugs.launchpad.net/bugs/110092.
- self.requireFeature(UnicodeFilename)
+ self.requireFeature(tests.UnicodeFilenameFeature)
# This bug isn't triggered with cStringIO.
from StringIO import StringIO
@@ -573,7 +544,7 @@
def test_unicode_filename(self):
"""Test when the filename are unicode."""
- self.requireFeature(UnicodeFilename)
+ self.requireFeature(tests.UnicodeFilenameFeature)
alpha, omega = u'\u03b1', u'\u03c9'
autf8, outf8 = alpha.encode('utf8'), omega.encode('utf8')
=== modified file 'bzrlib/tests/test_msgeditor.py'
--- a/bzrlib/tests/test_msgeditor.py 2007-12-19 08:12:34 +0000
+++ b/bzrlib/tests/test_msgeditor.py 2008-06-06 13:30:30 +0000
@@ -25,6 +25,7 @@
errors,
msgeditor,
osutils,
+ tests,
)
from bzrlib.branch import Branch
from bzrlib.config import ensure_config_dir_exists, config_filename
@@ -257,8 +258,7 @@
self.assertFileEqual(expected, msgfilename)
def test__create_temp_file_with_commit_template_in_unicode_dir(self):
- from bzrlib.tests.test_diff import UnicodeFilename
- self.requireFeature(UnicodeFilename)
+ self.requireFeature(tests.UnicodeFilenameFeature)
if hasattr(self, 'info'):
os.mkdir(self.info['directory'])
os.chdir(self.info['directory'])
=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py 2008-06-03 01:37:11 +0000
+++ b/bzrlib/tests/test_selftest.py 2008-06-06 13:56:24 +0000
@@ -1030,6 +1030,15 @@
self.assertEqual(None, result._extractBenchmarkTime(test))
+class TestUnicodeFilenameFeature(TestCase):
+
+ def test_probe_passes(self):
+ """UnicodeFilenameFeature._probe passes."""
+ # We can't test much more than that because the behaviour depends
+ # on the platform.
+ tests.UnicodeFilenameFeature._probe()
+
+
class TestRunner(TestCase):
def dummy_test(self):
More information about the bazaar-commits
mailing list