/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: Breezy landing bot
  • Author(s): Colin Watson
  • Date: 2020-11-16 21:47:08 UTC
  • mfrom: (7521.1.1 remove-lp-workaround)
  • Revision ID: breezy.the.bot@gmail.com-20201116214708-jos209mgxi41oy15
Remove breezy.git workaround for bazaar.launchpad.net.

Merged from https://code.launchpad.net/~cjwatson/brz/remove-lp-workaround/+merge/393710

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Blackbox tests for the 'bzr testament' command"""
 
17
"""Blackbox tests for the 'brz testament' command"""
18
18
 
19
19
import re
20
20
 
21
 
from bzrlib.tests.test_testament import (
 
21
from breezy.bzr.tests.test_testament import (
22
22
    osutils,
23
23
    REV_1_SHORT,
24
24
    REV_1_SHORT_STRICT,
28
28
 
29
29
 
30
30
class TestTestament(TestamentSetup):
31
 
    """Run blackbox tests on 'bzr testament'"""
 
31
    """Run blackbox tests on 'brz testament'"""
32
32
 
33
33
    def test_testament_command(self):
34
34
        """Testament containing a file and a directory."""
35
35
        out, err = self.run_bzr('testament --long')
36
36
        self.assertEqualDiff(err, '')
37
 
        self.assertEqualDiff(out, REV_2_TESTAMENT)
 
37
        self.assertEqualDiff(out, REV_2_TESTAMENT.decode('ascii'))
38
38
 
39
39
    def test_testament_command_2(self):
40
40
        """Command getting short testament of previous version."""
41
41
        out, err = self.run_bzr('testament -r1')
42
42
        self.assertEqualDiff(err, '')
43
 
        self.assertEqualDiff(out, REV_1_SHORT)
 
43
        self.assertEqualDiff(out, REV_1_SHORT.decode('ascii'))
44
44
 
45
45
    def test_testament_command_3(self):
46
46
        """Command getting short testament of previous version."""
47
47
        out, err = self.run_bzr('testament -r1 --strict')
48
48
        self.assertEqualDiff(err, '')
49
 
        self.assertEqualDiff(out, REV_1_SHORT_STRICT)
 
49
        self.assertEqualDiff(out, REV_1_SHORT_STRICT.decode('ascii'))
50
50
 
51
51
    def test_testament_non_ascii(self):
52
52
        self.wt.commit(u"Non \xe5ssci message")
53
 
        long_out, err = self.run_bzr('testament --long')
54
 
        self.assertEqualDiff(err, '')
55
 
        short_out, err = self.run_bzr('testament')
56
 
        self.assertEqualDiff(err, '')
57
 
        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)
58
59
        sha1 = sha1_re.search(short_out).group('sha1')
59
60
        self.assertEqual(sha1, osutils.sha_string(long_out))