~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/nosmart.py

(jelmer) Use the absolute_import feature everywhere in bzrlib,
 and add a source test to make sure it's used everywhere. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
to never have a smart medium.
22
22
"""
23
23
 
 
24
from __future__ import absolute_import
 
25
 
24
26
from bzrlib import errors
25
 
from bzrlib.transport.decorator import TransportDecorator, DecoratorServer
26
 
 
27
 
 
28
 
class NoSmartTransportDecorator(TransportDecorator):
 
27
from bzrlib.transport import decorator
 
28
 
 
29
 
 
30
class NoSmartTransportDecorator(decorator.TransportDecorator):
29
31
    """A decorator for transports that disables get_smart_medium."""
30
32
 
31
33
    @classmethod
36
38
        raise errors.NoSmartMedium(self)
37
39
 
38
40
 
39
 
class NoSmartTransportServer(DecoratorServer):
40
 
    """Server for the NoSmartTransportDecorator for testing with."""
41
 
 
42
 
    def get_decorator_class(self):
43
 
        return NoSmartTransportDecorator
44
 
 
45
 
 
46
41
def get_test_permutations():
47
42
    """Return the permutations to be used in testing."""
48
 
    return [(NoSmartTransportDecorator, NoSmartTransportServer)]
 
43
    from bzrlib.tests import test_server
 
44
    return [(NoSmartTransportDecorator, test_server.NoSmartTransportServer)]
49
45