/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-03-09 08:50:48 UTC
  • mfrom: (1553.5.83 bzr.mbp.locks)
  • Revision ID: pqm@pqm.ubuntu.com-20060309085048-37f21fd146dabe93
[merge] LockDir integration into new formats

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# little as possible, so this should be used rarely if it's added at all.
22
22
# (Suggestion from j-a-meinel, 2005-11-24)
23
23
 
 
24
# NOTE: Some classes in here use camelCaseNaming() rather than
 
25
# underscore_naming().  That's for consistency with unittest; it's not the
 
26
# general style of bzrlib.  Please continue that consistency when adding e.g.
 
27
# new assertFoo() methods.
 
28
 
24
29
import codecs
25
30
from cStringIO import StringIO
26
31
import difflib
795
800
            # TODO: rbc 20060208
796
801
            return WorkingTreeFormat2().initialize(bzrdir.BzrDir.open(relpath))
797
802
 
 
803
    def assertIsDirectory(self, relpath, transport):
 
804
        """Assert that relpath within transport is a directory.
 
805
 
 
806
        This may not be possible on all transports; in that case it propagates
 
807
        a TransportNotPossible.
 
808
        """
 
809
        try:
 
810
            mode = transport.stat(relpath).st_mode
 
811
        except errors.NoSuchFile:
 
812
            self.fail("path %s is not a directory; no such file"
 
813
                      % (relpath))
 
814
        if not stat.S_ISDIR(mode):
 
815
            self.fail("path %s is not a directory; has mode %#o"
 
816
                      % (relpath, mode))
 
817
 
798
818
 
799
819
class ChrootedTestCase(TestCaseWithTransport):
800
820
    """A support class that provides readonly urls outside the local namespace.