~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge cleanup into first-try

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    )
30
30
from bzrlib.tests import (
31
31
    blackbox,
 
32
    script,
32
33
    test_foreign,
33
34
    )
34
35
from bzrlib.tests.blackbox import test_push
58
59
    return result
59
60
 
60
61
 
61
 
class TestDpush(blackbox.ExternalBase):
 
62
class TestDpush(tests.TestCaseWithTransport):
62
63
 
63
64
    def setUp(self):
64
65
        super(TestDpush, self).setUp()
86
87
        self.build_tree(("dc/foo", "blaaaa"))
87
88
        dc.open_workingtree().commit('msg')
88
89
 
89
 
        output, error = self.run_bzr("dpush -d dc d")
90
 
        self.assertEquals(error, "Pushed up to revision 2.\n")
91
 
        self.check_output("", "status dc")
 
90
        script.run_script(self, """
 
91
            $ bzr dpush -d dc d
 
92
            2>Pushed up to revision 2.
 
93
            $ bzr status dc
 
94
            """)
92
95
 
93
96
    def test_dpush_new(self):
94
97
        b = self.make_dummy_builder('d').get_branch()
99
102
        dc_tree.add("foofile")
100
103
        dc_tree.commit("msg")
101
104
 
102
 
        self.check_output("", "dpush -d dc d")
103
 
        self.check_output("2\n", "revno dc")
104
 
        self.check_output("", "status dc")
 
105
        script.run_script(self, '''
 
106
            $ bzr dpush -d dc d
 
107
            $ bzr revno dc
 
108
            2
 
109
            $ bzr status dc
 
110
            ''')
105
111
 
106
112
    def test_dpush_wt_diff(self):
107
113
        b = self.make_dummy_builder('d').get_branch()
113
119
        newrevid = dc_tree.commit('msg')
114
120
 
115
121
        self.build_tree_contents([("dc/foofile", "blaaaal")])
116
 
        self.check_output("", "dpush -d dc d --no-strict")
 
122
        script.run_script(self, '''
 
123
            $ bzr dpush -d dc d --no-strict
 
124
            ''')
117
125
        self.assertFileEqual("blaaaal", "dc/foofile")
118
126
        # if the dummy vcs wasn't that dummy we could uncomment the line below
119
127
        # self.assertFileEqual("blaaaa", "d/foofile")
120
 
        self.check_output('modified:\n  foofile\n', "status dc")
 
128
        script.run_script(self, '''
 
129
            $ bzr status dc
 
130
            modified:
 
131
              foofile
 
132
            ''')
121
133
 
122
134
    def test_diverged(self):
123
135
        builder = self.make_dummy_builder('d')