/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
2046
2046
 
2047
2047
        This doesn't add anything to a branch.
2048
2048
 
 
2049
        :type shape:    list or tuple.
2049
2050
        :param line_endings: Either 'binary' or 'native'
2050
2051
            in binary mode, exact contents are written in native mode, the
2051
2052
            line endings match the default platform endings.
2053
2054
            If the transport is readonly or None, "." is opened automatically.
2054
2055
        :return: None
2055
2056
        """
 
2057
        if type(shape) not in (list, tuple):
 
2058
            raise AssertionError("Parameter 'shape' should be "
 
2059
                "a list or a tuple. Got %r instead" % (shape,))
2056
2060
        # It's OK to just create them using forward slashes on windows.
2057
2061
        if transport is None or transport.is_readonly():
2058
2062
            transport = get_transport(".")
2767
2771
        return 'FTPServer'
2768
2772
 
2769
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()