171
174
self.assertEqual([], delta.renamed)
172
175
self.assertEqual([], delta.removed)
173
176
self.assertEqual([(u'a', 'a-id', 'file')], delta.added)
179
class TestCommitDialog(tests.TestCaseWithTransport):
181
def test_no_pending(self):
182
tree = self.make_branch_and_tree('tree')
183
rev_id1 = tree.commit('one')
185
dlg = commit.CommitDialog(tree)
186
# TODO: assert that the pending box is hidden
188
def test_pending(self):
189
tree = self.make_branch_and_tree('tree')
190
rev_id1 = tree.commit('one')
192
tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
193
rev_id2 = tree2.commit('two',
194
committer='Joe Foo <joe@foo.com>',
195
timestamp=1191264271.05,
197
tree.merge_from_branch(tree2.branch)
199
dlg = commit.CommitDialog(tree)
200
# TODO: assert that the pending box is set to show
201
values = [(r[0], r[1], r[2], r[3]) for r in dlg._pending_liststore]
202
self.assertEqual([(rev_id2, '2007-10-01', 'Joe Foo', 'two')], values)
204
def test_pending_multiple(self):
205
tree = self.make_branch_and_tree('tree')
206
rev_id1 = tree.commit('one')
208
tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
209
rev_id2 = tree2.commit('two',
210
committer='Joe Foo <joe@foo.com>',
211
timestamp=1191264271.05,
213
rev_id3 = tree2.commit('three',
214
committer='Jerry Foo <jerry@foo.com>',
215
timestamp=1191264278.05,
217
tree.merge_from_branch(tree2.branch)
218
tree3 = tree.bzrdir.sprout('tree3').open_workingtree()
219
rev_id4 = tree3.commit('four',
220
committer='Joe Foo <joe@foo.com>',
221
timestamp=1191264279.05,
223
rev_id5 = tree3.commit('five',
224
committer='Jerry Foo <jerry@foo.com>',
225
timestamp=1191372278.05,
227
tree.merge_from_branch(tree3.branch)
229
dlg = commit.CommitDialog(tree)
230
# TODO: assert that the pending box is set to show
231
values = [(r[0], r[1], r[2], r[3]) for r in dlg._pending_liststore]
232
self.assertEqual([(rev_id3, '2007-10-01', 'Jerry Foo', 'three'),
233
(rev_id2, '2007-10-01', 'Joe Foo', 'two'),
234
(rev_id5, '2007-10-03', 'Jerry Foo', 'five'),
235
(rev_id4, '2007-10-01', 'Joe Foo', 'four'),