~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_fetch.py

Added progress bars to tree-changing operations

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
        target = BzrDir.create_branch_and_repo("target/")
198
198
        source = Branch.open(self.get_readonly_url("source/"))
199
199
        self.assertEqual(target.fetch(source), (2, []))
 
200
        log_pattern = '%%s HTTP/1.1" 200 - "-" "bzr/%s"' % bzrlib.__version__
200
201
        # this is the path to the literal file. As format changes 
201
202
        # occur it needs to be updated. FIXME: ask the store for the
202
203
        # path.
203
 
        weave_suffix = 'weaves/ce/id.weave HTTP/1.1" 200 -'
 
204
        weave_suffix = log_pattern % 'weaves/ce/id.weave'
204
205
        self.assertEqual(1,
205
206
            len([log for log in self.get_readonly_server().logs if log.endswith(weave_suffix)]))
206
 
        inventory_weave_suffix = 'inventory.weave HTTP/1.1" 200 -'
 
207
        inventory_weave_suffix = log_pattern % 'inventory.weave'
207
208
        self.assertEqual(1,
208
209
            len([log for log in self.get_readonly_server().logs if log.endswith(
209
210
                inventory_weave_suffix)]))
210
211
        # this r-h check test will prevent regressions, but it currently already 
211
212
        # passes, before the patch to cache-rh is applied :[
212
 
        revision_history_suffix = 'revision-history HTTP/1.1" 200 -'
 
213
        revision_history_suffix = log_pattern % 'revision-history'
213
214
        self.assertEqual(1,
214
215
            len([log for log in self.get_readonly_server().logs if log.endswith(
215
216
                revision_history_suffix)]))
218
219
        # check there is nothing more to fetch
219
220
        source = Branch.open(self.get_readonly_url("source/"))
220
221
        self.assertEqual(target.fetch(source), (0, []))
221
 
        self.failUnless(self.get_readonly_server().logs[0].endswith('branch-format HTTP/1.1" 200 -'))
222
 
        self.failUnless(self.get_readonly_server().logs[1].endswith('revision-history HTTP/1.1" 200 -'))
 
222
        self.failUnless(self.get_readonly_server().logs[0].endswith(log_pattern % 'branch-format'))
 
223
        self.failUnless(self.get_readonly_server().logs[1].endswith(log_pattern % 'revision-history'))
223
224
        self.assertEqual(2, len(self.get_readonly_server().logs))