~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: John Arbash Meinel
  • Date: 2013-05-19 14:29:37 UTC
  • mfrom: (6437.63.9 2.5)
  • mto: (6437.63.10 2.5)
  • mto: This revision was merged to the branch mainline in revision 6575.
  • Revision ID: john@arbash-meinel.com-20130519142937-21ykz2n2y2f22za9
Merge in the actual 2.5 branch. It seems I failed before

Show diffs side-by-side

added added

removed removed

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