179
179
self.assertEqual('1 revision(s) pushed.', message)
180
180
self.assertEqual(True, progress_panel.pb.update.called)
181
181
self.assertEqual(True, progress_panel.pb.finished.called)
183
def test_create_push_result_unstacked(self):
184
from_branch = object()
185
to_branch = self.make_branch_and_tree('that').branch
186
push_result = push.create_push_result(from_branch, to_branch)
187
self.assertIs(from_branch, push_result.source_branch)
188
self.assertIs(to_branch, push_result.target_branch)
189
self.assertIs(None, push_result.branch_push_result)
190
self.assertIs(None, push_result.master_branch)
191
self.assertEqual(0, push_result.old_revno)
192
self.assertEqual(to_branch.last_revision(), push_result.old_revid)
193
self.assertIs(None, push_result.workingtree_updated)
194
self.assertIs(None, push_result.stacked_on)
196
def test_create_push_result_stacked(self):
197
from_branch = object()
198
to_branch = self.make_branch_and_tree('that').branch
199
MockMethod.bind(self, to_branch, 'get_stacked_on_url', 'lp:project')
200
push_result = push.create_push_result(from_branch, to_branch)
201
self.assertEqual('lp:project', push_result.stacked_on)
203
def test_create_push_message_stacked_on(self):
204
from_branch = object()
205
to_branch = self.make_branch_and_tree('that').branch
206
MockMethod.bind(self, to_branch, 'get_stacked_on_url', 'lp:project')
207
push_result = push.create_push_result(from_branch, to_branch)
208
from_branch = self.make_from_branch()
209
message = push.create_push_message(from_branch, push_result)
211
'1 revision(s) pushed.\nStacked on lp:project.', message)
213
def test_create_push_message_workingtree_updated_false(self):
214
from_branch = object()
215
to_branch = self.make_branch_and_tree('that').branch
216
push_result = push.create_push_result(from_branch, to_branch)
217
push_result.workingtree_updated = False
218
from_branch = self.make_from_branch()
219
message = push.create_push_message(from_branch, push_result)
221
"1 revision(s) pushed.\n\nThe working tree was not updated:\n"
222
"See 'bzr help working-trees' for more information.",