~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_revision_info.py

  • Committer: Robert Collins
  • Date: 2005-10-06 22:15:52 UTC
  • mfrom: (1185.13.2)
  • mto: This revision was merged to the branch mainline in revision 1420.
  • Revision ID: robertc@robertcollins.net-20051006221552-9b15c96fa504e0ad
mergeĀ fromĀ upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import os
18
 
from bzrlib.tests import TestCaseInTempDir
 
18
from bzrlib.selftest import TestCaseInTempDir
19
19
from bzrlib.errors import BzrCommandError, NoSuchRevision
20
20
from bzrlib.branch import Branch
21
21
from bzrlib.revisionspec import RevisionSpec
28
28
        The output is supplied first, so that you can supply a variable
29
29
        number of arguments to bzr.
30
30
        """
31
 
        self.assertContainsRe(self.run_bzr_captured(args, retcode=3)[1], output)
 
31
        self.assertEquals(self.run_bzr_captured(args, retcode=1)[1], output)
32
32
 
33
33
    def check_output(self, output, *args):
34
34
        """Verify that the expected output matches what bzr says.
42
42
        """Test that 'bzr revision-info' reports the correct thing.
43
43
        """
44
44
 
45
 
        b = Branch.initialize(u'.')
 
45
        b = Branch.initialize('.')
46
46
 
47
 
        b.working_tree().commit('Commit one', rev_id='a@r-0-1')
48
 
        b.working_tree().commit('Commit two', rev_id='a@r-0-2')
49
 
        b.working_tree().commit('Commit three', rev_id='a@r-0-3')
 
47
        b.commit('Commit one', rev_id='a@r-0-1')
 
48
        b.commit('Commit two', rev_id='a@r-0-2')
 
49
        b.commit('Commit three', rev_id='a@r-0-3')
50
50
 
51
51
        # Make sure revision-info without any arguments throws an exception
52
 
        self.check_error('bzr: ERROR: '
53
 
                         'You must supply a revision identifier\n',
 
52
        self.check_error('bzr: ERROR: You must supply a revision identifier\n',
54
53
                         'revision-info')
55
54
 
56
55
        values = {
85
84
    def test_cat_revision(self):
86
85
        """Test bzr cat-revision.
87
86
        """
88
 
        b = Branch.initialize(u'.')
 
87
        b = Branch.initialize('.')
89
88
 
90
 
        b.working_tree().commit('Commit one', rev_id='a@r-0-1')
91
 
        b.working_tree().commit('Commit two', rev_id='a@r-0-2')
92
 
        b.working_tree().commit('Commit three', rev_id='a@r-0-3')
 
89
        b.commit('Commit one', rev_id='a@r-0-1')
 
90
        b.commit('Commit two', rev_id='a@r-0-2')
 
91
        b.commit('Commit three', rev_id='a@r-0-3')
93
92
 
94
93
        revs = {
95
 
            1:b.get_revision_xml('a@r-0-1'),
96
 
            2:b.get_revision_xml('a@r-0-2'),
97
 
            3:b.get_revision_xml('a@r-0-3')
 
94
            1:b.get_revision_xml_file('a@r-0-1').read(),
 
95
            2:b.get_revision_xml_file('a@r-0-2').read(),
 
96
            3:b.get_revision_xml_file('a@r-0-3').read()
98
97
        }
99
98
 
100
99
        self.check_output(revs[1], 'cat-revision', 'a@r-0-1')