60
60
def update(self, message, count=None, total=None):
61
61
"""See progress.ProgressBar.update()."""
62
62
if self.depth == 1:
63
self._calls.append(("update", count, total))
63
self._calls.append(("update", count, total, message))
66
66
class TestCapturingUI(TestCase):
75
75
pb2.update('foo', 0, 1)
78
self.assertEqual([("update", 0, 1)], factory._calls)
78
self.assertEqual([("update", 0, 1, 'foo')], factory._calls)
81
81
class TestCommit(TestCaseWithWorkingTree):
345
345
# into the factory for this test - just make the test ui factory
346
346
# pun as a reporter. Then we can check the ordering is right.
347
347
tree.commit('second post', specific_files=['b'])
348
# 9 steps: 1 for rev, 2 for inventory, 1 for finishing. 2 for root
349
# and 6 for inventory files.
350
# 2 steps don't trigger an update, as 'a' and 'c' are not
348
# 4 steps, the first of which is reported 5 times, once per file
349
# 2 files don't trigger an update, as 'a' and 'c' are not
352
351
self.assertEqual(
352
[('update', 1, 4, 'Collecting changes [Entry 0/?] - Stage'),
353
('update', 1, 4, 'Collecting changes [Entry 1/4] - Stage'),
354
('update', 1, 4, 'Collecting changes [Entry 2/4] - Stage'),
355
('update', 1, 4, 'Collecting changes [Entry 3/4] - Stage'),
356
('update', 1, 4, 'Collecting changes [Entry 4/4] - Stage'),
357
('update', 2, 4, 'Saving data locally - Stage'),
358
('update', 3, 4, 'Updating the working tree - Stage'),
359
('update', 4, 4, 'Running post commit hooks - Stage')],