~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_transport.py

(vila) Forbid more operations on ReadonlyTransportDecorator (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2015 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1640
1640
        self.assertRaises(errors.TransportNotPossible, self.transport.mkdir,
1641
1641
            'foo')
1642
1642
 
 
1643
    def test_rename_error_readonly(self):
 
1644
        """TransportNotPossible should be preserved from the backing transport."""
 
1645
        self.overrideEnv('BZR_NO_SMART_VFS', None)
 
1646
        self.start_server(readonly=True)
 
1647
        self.assertRaises(errors.TransportNotPossible, self.transport.rename,
 
1648
                          'foo', 'bar')
 
1649
 
 
1650
    def test_open_write_stream_error_readonly(self):
 
1651
        """TransportNotPossible should be preserved from the backing transport."""
 
1652
        self.overrideEnv('BZR_NO_SMART_VFS', None)
 
1653
        self.start_server(readonly=True)
 
1654
        self.assertRaises(
 
1655
            errors.TransportNotPossible, self.transport.open_write_stream,
 
1656
            'foo')
 
1657
 
1643
1658
 
1644
1659
class TestServerHooks(SmartTCPTests):
1645
1660