~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_controldir/test_controldir.py

(jelmer) Add ControlDirFormat.supports_workingtrees cvar. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for bzrdir implementations - tests a bzrdir format."""
18
18
 
19
 
from cStringIO import StringIO
20
19
import errno
21
20
from itertools import izip
22
21
import os
722
721
        try:
723
722
            target.open_workingtree()
724
723
        except errors.NoWorkingTree:
725
 
            # bzrdir's that never have working trees are allowed to pass;
726
 
            # whitelist them for now.
727
 
            self.assertIsInstance(target, RemoteBzrDir)
 
724
            # Some bzrdirs can never have working trees.
 
725
            self.assertFalse(target._format.supports_workingtrees)
728
726
 
729
727
    def test_sprout_bzrdir_empty_under_shared_repo_force_new(self):
730
728
        # the force_new_repo parameter should force use of a new repo in an empty
843
841
        self.assertNotEqual(dir.transport.base, shared_repo.bzrdir.transport.base)
844
842
        branch = target.open_branch()
845
843
        self.assertTrue(branch.repository.has_revision('1'))
846
 
        if not isinstance(branch.bzrdir, RemoteBzrDir):
 
844
        if branch.bzrdir._format.supports_workingtrees:
847
845
            self.assertTrue(branch.repository.make_working_trees())
848
846
        self.assertFalse(branch.repository.is_shared())
849
847