~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-06-06 13:56:24 UTC
  • mfrom: (3477.1.2 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080606135624-1ambbf8pct52xfh8
(jam) Move bzrlib.tests.test_diff.UnicodeFilename into
        bzrlib.tests.UnicodeFilenameFeature

Show diffs side-by-side

added added

removed removed

Lines of Context:
3063
3063
OsFifoFeature = _OsFifoFeature()
3064
3064
 
3065
3065
 
 
3066
class _UnicodeFilenameFeature(Feature):
 
3067
    """Does the filesystem support Unicode filenames?"""
 
3068
 
 
3069
    def _probe(self):
 
3070
        try:
 
3071
            os.stat(u'\u03b1')
 
3072
        except UnicodeEncodeError:
 
3073
            return False
 
3074
        except (IOError, OSError):
 
3075
            # The filesystem allows the Unicode filename but the file doesn't
 
3076
            # exist.
 
3077
            return True
 
3078
        else:
 
3079
            # The filesystem allows the Unicode filename and the file exists,
 
3080
            # for some reason.
 
3081
            return True
 
3082
 
 
3083
UnicodeFilenameFeature = _UnicodeFilenameFeature()
 
3084
 
 
3085
 
3066
3086
class TestScenarioApplier(object):
3067
3087
    """A tool to apply scenarios to tests."""
3068
3088