~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-13 07:17:06 UTC
  • mfrom: (1986.4.11 memory-tree-with-format)
  • Revision ID: pqm@pqm.ubuntu.com-20061013071706-5ef72f540f9d3fe3
(Robert Collins, John Arbash Meinel) Allow tests that require a specific branch or repository format to obtain that through TestCaseWithMemoryTree.make_branch_and_memory_tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import unittest
24
24
import warnings
25
25
 
26
 
from bzrlib import osutils, memorytree
27
26
import bzrlib
 
27
from bzrlib import (
 
28
    bzrdir,
 
29
    memorytree,
 
30
    osutils,
 
31
    repository,
 
32
    )
28
33
from bzrlib.progress import _BaseProgressBar
29
34
from bzrlib.tests import (
30
35
                          ChrootedTestCase,
465
470
        self.failIfExists('dir')
466
471
        self.assertIsInstance(tree, memorytree.MemoryTree)
467
472
 
 
473
    def test_make_branch_and_memory_tree_with_format(self):
 
474
        """make_branch_and_memory_tree should accept a format option."""
 
475
        format = bzrdir.BzrDirMetaFormat1()
 
476
        format.repository_format = repository.RepositoryFormat7()
 
477
        tree = self.make_branch_and_memory_tree('dir', format=format)
 
478
        self.failIfExists('dir')
 
479
        self.assertIsInstance(tree, memorytree.MemoryTree)
 
480
        self.assertEqual(format.repository_format.__class__,
 
481
            tree.branch.repository._format.__class__)
 
482
 
468
483
 
469
484
class TestTestCaseWithTransport(TestCaseWithTransport):
470
485
    """Tests for the convenience functions TestCaseWithTransport introduces."""