/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_commit.py

  • Committer: John Arbash Meinel
  • Date: 2007-10-01 20:03:50 UTC
  • mto: (322.1.1 trunk) (330.3.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: john@arbash-meinel.com-20071001200350-y4b9uh0rw5kjrfmf
Tests that we fill out the pending list correctly.
We should consider switching to a nested view. But that may
be unnecessary, since typically we only have 1 top level merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
    def construct(self):
122
122
        pass # Don't create any widgets here
123
123
 
124
 
 
125
 
class TestCommitDialog(tests.TestCaseWithTransport):
 
124
    def fill_in_data(self):
 
125
        pass # With no widgets, there are no widgets to fill out
 
126
 
 
127
 
 
128
class TestCommitDialogSimple(tests.TestCaseWithTransport):
126
129
 
127
130
    def test_setup_parameters_no_pending(self):
128
131
        tree = self.make_branch_and_tree('tree')
171
174
        self.assertEqual([], delta.renamed)
172
175
        self.assertEqual([], delta.removed)
173
176
        self.assertEqual([(u'a', 'a-id', 'file')], delta.added)
 
177
 
 
178
 
 
179
class TestCommitDialog(tests.TestCaseWithTransport):
 
180
 
 
181
    def test_no_pending(self):
 
182
        tree = self.make_branch_and_tree('tree')
 
183
        rev_id1 = tree.commit('one')
 
184
 
 
185
        dlg = commit.CommitDialog(tree)
 
186
        # TODO: assert that the pending box is hidden
 
187
 
 
188
    def test_pending(self):
 
189
        tree = self.make_branch_and_tree('tree')
 
190
        rev_id1 = tree.commit('one')
 
191
 
 
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,
 
196
                               timezone=+7200)
 
197
        tree.merge_from_branch(tree2.branch)
 
198
 
 
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)
 
203
 
 
204
    def test_pending_multiple(self):
 
205
        tree = self.make_branch_and_tree('tree')
 
206
        rev_id1 = tree.commit('one')
 
207
 
 
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,
 
212
                               timezone=+7200)
 
213
        rev_id3 = tree2.commit('three',
 
214
                               committer='Jerry Foo <jerry@foo.com>',
 
215
                               timestamp=1191264278.05,
 
216
                               timezone=+7200)
 
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,
 
222
                               timezone=+7200)
 
223
        rev_id5 = tree3.commit('five',
 
224
                               committer='Jerry Foo <jerry@foo.com>',
 
225
                               timestamp=1191372278.05,
 
226
                               timezone=+7200)
 
227
        tree.merge_from_branch(tree3.branch)
 
228
 
 
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'),
 
236
                         ], values)