~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2007-12-05 22:52:58 UTC
  • mfrom: (3080 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3084.
  • Revision ID: john@arbash-meinel.com-20071205225258-kn799zf3tewncv7p
[merge] bzr.dev 3080

Show diffs side-by-side

added added

removed removed

Lines of Context:
2771
2771
        return 'FTPServer'
2772
2772
 
2773
2773
FTPServerFeature = _FTPServerFeature()
 
2774
 
 
2775
 
 
2776
class _CaseInsensitiveFilesystemFeature(Feature):
 
2777
    """Check if underlined filesystem is case-insensitive
 
2778
    (e.g. on Windows, Cygwin, MacOS)
 
2779
    """
 
2780
 
 
2781
    def _probe(self):
 
2782
        if TestCaseWithMemoryTransport.TEST_ROOT is None:
 
2783
            root = osutils.mkdtemp(prefix='testbzr-', suffix='.tmp')
 
2784
            TestCaseWithMemoryTransport.TEST_ROOT = root
 
2785
        else:
 
2786
            root = TestCaseWithMemoryTransport.TEST_ROOT
 
2787
        tdir = osutils.mkdtemp(prefix='case-sensitive-probe-', suffix='',
 
2788
            dir=root)
 
2789
        name_a = osutils.pathjoin(tdir, 'a')
 
2790
        name_A = osutils.pathjoin(tdir, 'A')
 
2791
        os.mkdir(name_a)
 
2792
        result = osutils.isdir(name_A)
 
2793
        _rmtree_temp_dir(tdir)
 
2794
        return result
 
2795
 
 
2796
    def feature_name(self):
 
2797
        return 'case-insensitive filesystem'
 
2798
 
 
2799
CaseInsensitiveFilesystemFeature = _CaseInsensitiveFilesystemFeature()