~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        except excClass:
69
69
            return
70
70
        else:
71
 
            if hasattr(excClass,'__name__'): excName = excClass.__name__
72
 
            else: excName = str(excClass)
 
71
            if getattr(excClass,'__name__', None) is not None:
 
72
                excName = excClass.__name__
 
73
            else:
 
74
                excName = str(excClass)
73
75
            raise self.failureException, "%s not raised" % excName
74
76
 
75
77
    def test_has(self):
749
751
        t.mkdir('adir/asubdir')
750
752
        t.mkdir('bdir')
751
753
        t.mkdir('bdir/bsubdir')
 
754
        # any kind of PathError would be OK, though we normally expect
 
755
        # DirectoryNotEmpty
752
756
        self.assertRaises(PathError, t.rename, 'bdir', 'adir')
753
757
        # nothing was changed so it should still be as before
754
758
        self.assertTrue(t.has('bdir/bsubdir'))
839
843
        # TODO: test copy_multi
840
844
 
841
845
    def test_connection_error(self):
842
 
        """ConnectionError is raised when connection is impossible"""
 
846
        """ConnectionError is raised when connection is impossible.
 
847
        
 
848
        The error may be raised from either the constructor or the first
 
849
        operation on the transport.
 
850
        """
843
851
        try:
844
852
            url = self._server.get_bogus_url()
845
853
        except NotImplementedError: