~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_testament.py

  • Committer: John Arbash Meinel
  • Date: 2013-06-24 12:03:12 UTC
  • mfrom: (6437.77.2 2.5)
  • mto: This revision was merged to the branch mainline in revision 6579.
  • Revision ID: john@arbash-meinel.com-20130624120312-pmvck24x052csigx
Merge lp:bzr/2.5 r6515 to get the fix for bug #855155 (Dirstate.update_basis_by_delta)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Blackbox tests for the 'bzr testament' command"""
18
18
 
 
19
import re
19
20
 
20
21
from bzrlib.tests.test_testament import (
 
22
    osutils,
21
23
    REV_1_SHORT,
22
24
    REV_1_SHORT_STRICT,
23
25
    REV_2_TESTAMENT,
30
32
 
31
33
    def test_testament_command(self):
32
34
        """Testament containing a file and a directory."""
33
 
        out, err = self.run_bzr('testament', '--long')
 
35
        out, err = self.run_bzr('testament --long')
34
36
        self.assertEqualDiff(err, '')
35
37
        self.assertEqualDiff(out, REV_2_TESTAMENT)
36
38
 
37
39
    def test_testament_command_2(self):
38
40
        """Command getting short testament of previous version."""
39
 
        out, err = self.run_bzr('testament', '-r1')
 
41
        out, err = self.run_bzr('testament -r1')
40
42
        self.assertEqualDiff(err, '')
41
43
        self.assertEqualDiff(out, REV_1_SHORT)
42
44
 
43
45
    def test_testament_command_3(self):
44
46
        """Command getting short testament of previous version."""
45
 
        out, err = self.run_bzr('testament', '-r1', '--strict')
 
47
        out, err = self.run_bzr('testament -r1 --strict')
46
48
        self.assertEqualDiff(err, '')
47
49
        self.assertEqualDiff(out, REV_1_SHORT_STRICT)
48
50
 
 
51
    def test_testament_non_ascii(self):
 
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)
 
58
        sha1 = sha1_re.search(short_out).group('sha1')
 
59
        self.assertEqual(sha1, osutils.sha_string(long_out))