/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/blackbox/test_testament.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:
18
18
 
19
19
import re
20
20
 
21
 
from breezy.sixish import PY3
22
 
from breezy.tests.test_testament import (
 
21
from breezy.bzr.tests.test_testament import (
23
22
    osutils,
24
23
    REV_1_SHORT,
25
24
    REV_1_SHORT_STRICT,
35
34
        """Testament containing a file and a directory."""
36
35
        out, err = self.run_bzr('testament --long')
37
36
        self.assertEqualDiff(err, '')
38
 
        self.assertEqualDiff(out, REV_2_TESTAMENT.decode('utf-8'))
 
37
        self.assertEqualDiff(out, REV_2_TESTAMENT.decode('ascii'))
39
38
 
40
39
    def test_testament_command_2(self):
41
40
        """Command getting short testament of previous version."""
42
41
        out, err = self.run_bzr('testament -r1')
43
42
        self.assertEqualDiff(err, '')
44
 
        self.assertEqualDiff(out, REV_1_SHORT.decode('utf-8'))
 
43
        self.assertEqualDiff(out, REV_1_SHORT.decode('ascii'))
45
44
 
46
45
    def test_testament_command_3(self):
47
46
        """Command getting short testament of previous version."""
48
47
        out, err = self.run_bzr('testament -r1 --strict')
49
48
        self.assertEqualDiff(err, '')
50
 
        self.assertEqualDiff(out, REV_1_SHORT_STRICT.decode('utf-8'))
 
49
        self.assertEqualDiff(out, REV_1_SHORT_STRICT.decode('ascii'))
51
50
 
52
51
    def test_testament_non_ascii(self):
53
52
        self.wt.commit(u"Non \xe5ssci message")
54
 
        long_out, err = self.run_bzr('testament --long')
55
 
        self.assertEqualDiff(err, '')
56
 
        short_out, err = self.run_bzr('testament')
57
 
        self.assertEqualDiff(err, '')
58
 
        sha1_re = re.compile('sha1: (?P<sha1>[a-f0-9]+)$', re.M)
 
53
        long_out, err = self.run_bzr_raw('testament --long', encoding='utf-8')
 
54
        self.assertEqualDiff(err, b'')
 
55
        long_out, err = self.run_bzr_raw('testament --long', encoding='ascii')
 
56
        short_out, err = self.run_bzr_raw('testament', encoding='ascii')
 
57
        self.assertEqualDiff(err, b'')
 
58
        sha1_re = re.compile(b'sha1: (?P<sha1>[a-f0-9]+)$', re.M)
59
59
        sha1 = sha1_re.search(short_out).group('sha1')
60
 
        self.assertEqual(
61
 
            sha1.encode('ascii'),
62
 
            osutils.sha_string(long_out.encode('utf-8') if PY3 else long_out))
 
60
        self.assertEqual(sha1, osutils.sha_string(long_out))