~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Patch Queue Manager
  • Date: 2012-09-19 08:27:25 UTC
  • mfrom: (6562.1.1 2.6-merge-up-2.5)
  • Revision ID: pqm@pqm.ubuntu.com-20120919082725-dzvmca37zj5xx2hh
(jam) Merge bzr-2.5.2-dev into bzr trunk to get the ConnectionReset
        fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
335
335
        server1 = "a"
336
336
        server2 = "b"
337
337
        formats = [workingtree_4.WorkingTreeFormat4(),
338
 
                   workingtree_3.WorkingTreeFormat3(),]
339
 
        scenarios = make_scenarios(server1, server2, formats)
 
338
                   workingtree_3.WorkingTreeFormat3(),
 
339
                   workingtree_4.WorkingTreeFormat6()]
 
340
        scenarios = make_scenarios(server1, server2, formats,
 
341
            remote_server='c', remote_readonly_server='d',
 
342
            remote_backing_server='e')
340
343
        self.assertEqual([
341
344
            ('WorkingTreeFormat4',
342
345
             {'bzrdir_format': formats[0]._matchingbzrdir,
347
350
             {'bzrdir_format': formats[1]._matchingbzrdir,
348
351
              'transport_readonly_server': 'b',
349
352
              'transport_server': 'a',
350
 
              'workingtree_format': formats[1]})],
351
 
            scenarios)
 
353
              'workingtree_format': formats[1]}),
 
354
            ('WorkingTreeFormat6',
 
355
             {'bzrdir_format': formats[2]._matchingbzrdir,
 
356
              'transport_readonly_server': 'b',
 
357
              'transport_server': 'a',
 
358
              'workingtree_format': formats[2]}),
 
359
            ('WorkingTreeFormat6,remote',
 
360
             {'bzrdir_format': formats[2]._matchingbzrdir,
 
361
              'repo_is_remote': True,
 
362
              'transport_readonly_server': 'd',
 
363
              'transport_server': 'c',
 
364
              'vfs_transport_factory': 'e',
 
365
              'workingtree_format': formats[2]}),
 
366
            ], scenarios)
352
367
 
353
368
 
354
369
class TestTreeScenarios(tests.TestCase):
355
370
 
356
371
    def test_scenarios(self):
357
372
        # the tree implementation scenario generator is meant to setup one
358
 
        # instance for each working tree format, and one additional instance
 
373
        # instance for each working tree format, one additional instance
359
374
        # that will use the default wt format, but create a revision tree for
360
 
        # the tests.  this means that the wt ones should have the
361
 
        # workingtree_to_test_tree attribute set to 'return_parameter' and the
362
 
        # revision one set to revision_tree_from_workingtree.
 
375
        # the tests, and one more that uses the default wt format as a
 
376
        # lightweight checkout of a remote repository.  This means that the wt
 
377
        # ones should have the workingtree_to_test_tree attribute set to
 
378
        # 'return_parameter' and the revision one set to
 
379
        # revision_tree_from_workingtree.
363
380
 
364
381
        from bzrlib.tests.per_tree import (
365
382
            _dirstate_tree_from_workingtree,
371
388
            )
372
389
        server1 = "a"
373
390
        server2 = "b"
 
391
        smart_server = test_server.SmartTCPServer_for_testing
 
392
        smart_readonly_server = test_server.ReadonlySmartTCPServer_for_testing
 
393
        mem_server = memory.MemoryServer
374
394
        formats = [workingtree_4.WorkingTreeFormat4(),
375
395
                   workingtree_3.WorkingTreeFormat3(),]
376
396
        scenarios = make_scenarios(server1, server2, formats)
377
 
        self.assertEqual(7, len(scenarios))
 
397
        self.assertEqual(8, len(scenarios))
378
398
        default_wt_format = workingtree.format_registry.get_default()
379
399
        wt4_format = workingtree_4.WorkingTreeFormat4()
380
400
        wt5_format = workingtree_4.WorkingTreeFormat5()
 
401
        wt6_format = workingtree_4.WorkingTreeFormat6()
381
402
        expected_scenarios = [
382
403
            ('WorkingTreeFormat4',
383
404
             {'bzrdir_format': formats[0]._matchingbzrdir,
393
414
              'workingtree_format': formats[1],
394
415
              '_workingtree_to_test_tree': return_parameter,
395
416
             }),
 
417
            ('WorkingTreeFormat6,remote',
 
418
             {'bzrdir_format': wt6_format._matchingbzrdir,
 
419
              'repo_is_remote': True,
 
420
              'transport_readonly_server': smart_readonly_server,
 
421
              'transport_server': smart_server,
 
422
              'vfs_transport_factory': mem_server,
 
423
              'workingtree_format': wt6_format,
 
424
              '_workingtree_to_test_tree': return_parameter,
 
425
             }),
396
426
            ('RevisionTree',
397
427
             {'_workingtree_to_test_tree': revision_tree_from_workingtree,
398
428
              'bzrdir_format': default_wt_format._matchingbzrdir,