/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 breezy/tests/test_osutils_encodings.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from .. import (
24
24
    osutils,
25
25
    )
26
 
from ..sixish import PY3
27
26
from . import (
28
27
    TestCase,
29
28
    )
88
87
                             stdin_encoding,
89
88
                             user_encoding='user_encoding',
90
89
                             enable_fake_encodings=True):
91
 
        if PY3:
92
 
            sys.stdout = StringIOWithEncoding()
93
 
        else:
94
 
            sys.stdout = BytesIOWithEncoding()
 
90
        sys.stdout = StringIOWithEncoding()
95
91
        sys.stdout.encoding = stdout_encoding
96
 
        if PY3:
97
 
            sys.stderr = StringIOWithEncoding()
98
 
        else:
99
 
            sys.stderr = BytesIOWithEncoding()
 
92
        sys.stderr = StringIOWithEncoding()
100
93
        sys.stderr.encoding = stderr_encoding
101
 
        if PY3:
102
 
            sys.stdin = StringIOWithEncoding()
103
 
        else:
104
 
            sys.stdin = BytesIOWithEncoding()
 
94
        sys.stdin = StringIOWithEncoding()
105
95
        sys.stdin.encoding = stdin_encoding
106
96
        osutils._cached_user_encoding = user_encoding
107
97
        if enable_fake_encodings:
184
174
        self.overrideAttr(osutils, '_cached_user_encoding', None)
185
175
        self.overrideAttr(locale, 'getpreferredencoding', self.get_encoding)
186
176
        self.overrideAttr(locale, 'CODESET', None)
187
 
        if PY3:
188
 
            self.overrideAttr(sys, 'stderr', StringIOWithEncoding())
189
 
        else:
190
 
            self.overrideAttr(sys, 'stderr', BytesIOWithEncoding())
 
177
        self.overrideAttr(sys, 'stderr', StringIOWithEncoding())
191
178
 
192
179
    def get_encoding(self, do_setlocale=True):
193
180
        return self._encoding