~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_transport.py

  • Committer: Vincent Ladeuil
  • Date: 2016-01-22 08:02:12 UTC
  • mfrom: (6612 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6613.
  • Revision ID: v.ladeuil+lp@free.fr-20160122080212-iz2fcz6n0su5px7g
Merge trunk resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
609
609
    def test_opening_a_file_stream_can_set_mode(self):
610
610
        t = self.get_transport()
611
611
        if t.is_readonly():
 
612
            self.assertRaises((TransportNotPossible, NotImplementedError),
 
613
                              t.open_write_stream, 'foo')
612
614
            return
613
615
        if not t._can_roundtrip_unix_modebits():
614
616
            # Can't roundtrip, so no need to run this test
615
617
            return
 
618
 
616
619
        def check_mode(name, mode, expected):
617
620
            handle = t.open_write_stream(name, mode=mode)
618
621
            handle.close()
900
903
    def test_rename_dir_succeeds(self):
901
904
        t = self.get_transport()
902
905
        if t.is_readonly():
903
 
            raise TestSkipped("transport is readonly")
 
906
            self.assertRaises((TransportNotPossible, NotImplementedError),
 
907
                              t.rename, 'foo', 'bar')
 
908
            return
904
909
        t.mkdir('adir')
905
910
        t.mkdir('adir/asubdir')
906
911
        t.rename('adir', 'bdir')
911
916
        """Attempting to replace a nonemtpy directory should fail"""
912
917
        t = self.get_transport()
913
918
        if t.is_readonly():
914
 
            raise TestSkipped("transport is readonly")
 
919
            self.assertRaises((TransportNotPossible, NotImplementedError),
 
920
                              t.rename, 'foo', 'bar')
 
921
            return
915
922
        t.mkdir('adir')
916
923
        t.mkdir('adir/asubdir')
917
924
        t.mkdir('bdir')