Rev 6139: Change the import lines. in http://bazaar.launchpad.net/~jameinel/bzr/2.5-pyflakes-cleanups

John Arbash Meinel john at arbash-meinel.com
Thu Sep 15 09:05:19 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.5-pyflakes-cleanups

------------------------------------------------------------
revno: 6139
revision-id: john at arbash-meinel.com-20110915090505-g1ol1o06i81rxcee
parent: pqm at pqm.ubuntu.com-20110913223616-elmegupmpxd9s6oi
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.5-pyflakes-cleanups
timestamp: Thu 2011-09-15 11:05:05 +0200
message:
  Change the import lines.
  
  We had lots of code that was doing 'server = xxx_create_server', however
  we also did 'from bzrlib import server'. This makes pyflakes angry :).
-------------- next part --------------
=== modified file 'bzrlib/tests/test_smart_transport.py'
--- a/bzrlib/tests/test_smart_transport.py	2011-08-19 22:34:02 +0000
+++ b/bzrlib/tests/test_smart_transport.py	2011-09-15 09:05:05 +0000
@@ -28,7 +28,7 @@
         errors,
         osutils,
         tests,
-        transport,
+        transport as _mod_transport,
         urlutils,
         )
 from bzrlib.smart import (
@@ -37,7 +37,7 @@
         message,
         protocol,
         request as _mod_request,
-        server,
+        server as _mod_server,
         vfs,
 )
 from bzrlib.tests import (
@@ -1015,15 +1015,15 @@
             mem_server.start_server()
             self.addCleanup(mem_server.stop_server)
             self.permit_url(mem_server.get_url())
-            self.backing_transport = transport.get_transport_from_url(
+            self.backing_transport = _mod_transport.get_transport_from_url(
                 mem_server.get_url())
         else:
             self.backing_transport = backing_transport
         if readonly:
             self.real_backing_transport = self.backing_transport
-            self.backing_transport = transport.get_transport_from_url(
+            self.backing_transport = _mod_transport.get_transport_from_url(
                 "readonly+" + self.backing_transport.abspath('.'))
-        self.server = server.SmartTCPServer(self.backing_transport)
+        self.server = _mod_server.SmartTCPServer(self.backing_transport)
         self.server.start_server('127.0.0.1', 0)
         self.server.start_background_thread('-' + self.id())
         self.transport = remote.RemoteTCPTransport(self.server.get_url())
@@ -1163,7 +1163,7 @@
     def test_server_started_hook_memory(self):
         """The server_started hook fires when the server is started."""
         self.hook_calls = []
-        server.SmartTCPServer.hooks.install_named_hook('server_started',
+        _mod_server.SmartTCPServer.hooks.install_named_hook('server_started',
             self.capture_server_call, None)
         self.start_server()
         # at this point, the server will be starting a thread up.
@@ -1177,10 +1177,10 @@
     def test_server_started_hook_file(self):
         """The server_started hook fires when the server is started."""
         self.hook_calls = []
-        server.SmartTCPServer.hooks.install_named_hook('server_started',
+        _mod_server.SmartTCPServer.hooks.install_named_hook('server_started',
             self.capture_server_call, None)
         self.start_server(
-            backing_transport=transport.get_transport_from_path("."))
+            backing_transport=_mod_transport.get_transport_from_path("."))
         # at this point, the server will be starting a thread up.
         # there is no indicator at the moment, so bodge it by doing a request.
         self.transport.has('.')
@@ -1194,7 +1194,7 @@
     def test_server_stopped_hook_simple_memory(self):
         """The server_stopped hook fires when the server is stopped."""
         self.hook_calls = []
-        server.SmartTCPServer.hooks.install_named_hook('server_stopped',
+        _mod_server.SmartTCPServer.hooks.install_named_hook('server_stopped',
             self.capture_server_call, None)
         self.start_server()
         result = [([self.backing_transport.base], self.transport.base)]
@@ -1211,10 +1211,10 @@
     def test_server_stopped_hook_simple_file(self):
         """The server_stopped hook fires when the server is stopped."""
         self.hook_calls = []
-        server.SmartTCPServer.hooks.install_named_hook('server_stopped',
+        _mod_server.SmartTCPServer.hooks.install_named_hook('server_stopped',
             self.capture_server_call, None)
         self.start_server(
-            backing_transport=transport.get_transport_from_path("."))
+            backing_transport=_mod_transport.get_transport_from_path("."))
         result = [(
             [self.backing_transport.base, self.backing_transport.external_url()]
             , self.transport.base)]
@@ -1356,13 +1356,13 @@
 class RemoteTransportRegistration(tests.TestCase):
 
     def test_registration(self):
-        t = transport.get_transport_from_url('bzr+ssh://example.com/path')
+        t = _mod_transport.get_transport_from_url('bzr+ssh://example.com/path')
         self.assertIsInstance(t, remote.RemoteSSHTransport)
         self.assertEqual('example.com', t._parsed_url.host)
 
     def test_bzr_https(self):
         # https://bugs.launchpad.net/bzr/+bug/128456
-        t = transport.get_transport_from_url('bzr+https://example.com/path')
+        t = _mod_transport.get_transport_from_url('bzr+https://example.com/path')
         self.assertIsInstance(t, remote.RemoteHTTPTransport)
         self.assertStartsWith(
             t._http_transport.base,



More information about the bazaar-commits mailing list