1
# Copyright (C) 2006, 2007, 2008, 2009 Canonical Ltd
1
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
17
"""Tests for the Repository facility that are not interface tests.
1121
1120
self.assertTrue(new_pack.inventory_index._optimize_for_size)
1122
1121
self.assertTrue(new_pack.text_index._optimize_for_size)
1123
1122
self.assertTrue(new_pack.signature_index._optimize_for_size)
1125
class TestInterDifferingSerializer(TestCaseWithTransport):
1127
def test_progress_bar(self):
1128
tree = self.make_branch_and_tree('tree')
1129
tree.commit('rev1', rev_id='rev-1')
1130
tree.commit('rev2', rev_id='rev-2')
1131
tree.commit('rev3', rev_id='rev-3')
1132
repo = self.make_repository('repo')
1133
inter_repo = repository.InterDifferingSerializer(
1134
tree.branch.repository, repo)
1135
pb = progress.InstrumentedProgress(to_file=StringIO())
1136
pb.never_throttle = True
1137
inter_repo.fetch('rev-1', pb)
1138
self.assertEqual('Transferring revisions', pb.last_msg)
1139
self.assertEqual(1, pb.last_cnt)
1140
self.assertEqual(1, pb.last_total)
1141
inter_repo.fetch('rev-3', pb)
1142
self.assertEqual(2, pb.last_cnt)
1143
self.assertEqual(2, pb.last_total)