~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2007-06-26 08:02:36 UTC
  • mto: This revision was merged to the branch mainline in revision 2555.
  • Revision ID: mbp@sourcefrog.net-20070626080236-14ihgomtffc9tezj
Cleanup old variations on run_bzr in the test suite

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
class TestRevert(ExternalBase):
28
28
 
29
29
    def _prepare_tree(self):
30
 
        self.runbzr('init')
31
 
        self.runbzr('mkdir dir')
 
30
        self.run_bzr('init')
 
31
        self.run_bzr('mkdir dir')
32
32
 
33
33
        f = file('dir/file', 'wb')
34
34
        f.write('spam')
35
35
        f.close()
36
 
        self.runbzr('add dir/file')
 
36
        self.run_bzr('add dir/file')
37
37
 
38
 
        self.runbzr('commit -m1')
 
38
        self.run_bzr('commit -m1')
39
39
 
40
40
        # modify file
41
41
        f = file('dir/file', 'wb')
43
43
        f.close()
44
44
 
45
45
        # check status
46
 
        self.assertEquals('modified:\n  dir/file\n', self.capture('status'))
 
46
        self.assertEquals('modified:\n  dir/file\n', self.run_bzr_captured(['status'])[0])
47
47
 
48
48
    def _prepare_rename_mod_tree(self):
49
49
        self.build_tree(['a/', 'a/b', 'a/c', 'a/d/', 'a/d/e', 'f/', 'f/g', 
66
66
        os.chdir('dir')
67
67
        mutter('cd dir\n')
68
68
 
69
 
        self.assertEquals('1\n', self.capture('revno'))
70
 
        self.runbzr('revert %s file' % param)
 
69
        self.assertEquals('1\n', self.run_bzr_captured(['revno'])[0])
 
70
        self.run_bzr('revert %s file' % param)
71
71
        self.assertEquals('spam', open('file', 'rb').read())
72
72
 
73
73
    def test_revert_in_subdir(self):
82
82
        os.mkdir('brach')
83
83
        os.chdir('brach')
84
84
        self._prepare_tree()
85
 
        self.runbzr('checkout --lightweight . ../sprach')
86
 
        self.runbzr('commit -m more')
 
85
        self.run_bzr('checkout --lightweight . ../sprach')
 
86
        self.run_bzr('commit -m more')
87
87
        os.chdir('../sprach')
88
 
        self.assertEqual('', self.capture('status'))
89
 
        self.runbzr('revert')
90
 
        self.assertEqual('', self.capture('status'))
 
88
        self.assertEqual('', self.run_bzr_captured(['status'])[0])
 
89
        self.run_bzr('revert')
 
90
        self.assertEqual('', self.run_bzr_captured(['status'])[0])
91
91
 
92
92
    def test_revert_dirname(self):
93
93
        """Test that revert DIRECTORY does what's expected"""