Rev 5019: Fix test_smart_transport.py imports. in file:///home/vila/src/bzr/cleanup/test-imports/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Feb 5 15:26:17 GMT 2010


At file:///home/vila/src/bzr/cleanup/test-imports/

------------------------------------------------------------
revno: 5019
revision-id: v.ladeuil+lp at free.fr-20100205152617-6p9rf9b0m4ucvn0u
parent: v.ladeuil+lp at free.fr-20100205152051-g162emr4eljaiiis
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: test-imports
timestamp: Fri 2010-02-05 16:26:17 +0100
message:
  Fix test_smart_transport.py imports.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_smart_transport.py'
--- a/bzrlib/tests/test_smart_transport.py	2010-01-07 03:03:01 +0000
+++ b/bzrlib/tests/test_smart_transport.py	2010-02-05 15:26:17 +0000
@@ -28,6 +28,7 @@
         errors,
         osutils,
         tests,
+        transport,
         urlutils,
         )
 from bzrlib.smart import (
@@ -39,14 +40,13 @@
         server,
         vfs,
 )
-from bzrlib.tests.test_smart import TestCaseWithSmartMedium
+from bzrlib.tests import test_smart
 from bzrlib.transport import (
-        get_transport,
+        http,
         local,
         memory,
         remote,
         )
-from bzrlib.transport.http import SmartClientHTTPMediumRequest
 
 
 class StringIOSSHVendor(object):
@@ -557,7 +557,7 @@
         self.assertRaises(errors.ReadingCompleted, request.read_bytes, None)
 
 
-class RemoteTransportTests(TestCaseWithSmartMedium):
+class RemoteTransportTests(test_smart.TestCaseWithSmartMedium):
 
     def test_plausible_url(self):
         self.assert_(self.get_url().startswith('bzr://'))
@@ -1003,12 +1003,14 @@
             mem_server.start_server()
             self.addCleanup(mem_server.stop_server)
             self.permit_url(mem_server.get_url())
-            self.backing_transport = get_transport(mem_server.get_url())
+            self.backing_transport = transport.get_transport(
+                mem_server.get_url())
         else:
             self.backing_transport = backing_transport
         if readonly:
             self.real_backing_transport = self.backing_transport
-            self.backing_transport = get_transport("readonly+" + self.backing_transport.abspath('.'))
+            self.backing_transport = transport.get_transport(
+                "readonly+" + self.backing_transport.abspath('.'))
         self.server = server.SmartTCPServer(self.backing_transport)
         self.server.start_background_thread('-' + self.id())
         self.transport = remote.RemoteTCPTransport(self.server.get_url())
@@ -1161,7 +1163,7 @@
         self.hook_calls = []
         server.SmartTCPServer.hooks.install_named_hook('server_started',
             self.capture_server_call, None)
-        self.start_server(backing_transport=get_transport("."))
+        self.start_server(backing_transport=transport.get_transport("."))
         # 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 +1196,7 @@
         self.hook_calls = []
         server.SmartTCPServer.hooks.install_named_hook('server_stopped',
             self.capture_server_call, None)
-        self.start_server(backing_transport=get_transport("."))
+        self.start_server(backing_transport=transport.get_transport("."))
         result = [(
             [self.backing_transport.base, self.backing_transport.external_url()]
             , self.transport.base)]
@@ -1339,13 +1341,13 @@
 class RemoteTransportRegistration(tests.TestCase):
 
     def test_registration(self):
-        t = get_transport('bzr+ssh://example.com/path')
+        t = transport.get_transport('bzr+ssh://example.com/path')
         self.assertIsInstance(t, remote.RemoteSSHTransport)
         self.assertEqual('example.com', t._host)
 
     def test_bzr_https(self):
         # https://bugs.launchpad.net/bzr/+bug/128456
-        t = get_transport('bzr+https://example.com/path')
+        t = transport.get_transport('bzr+https://example.com/path')
         self.assertIsInstance(t, remote.RemoteHTTPTransport)
         self.assertStartsWith(
             t._http_transport.base,
@@ -3516,7 +3518,7 @@
 
     def test_smart_http_medium_request_accept_bytes(self):
         medium = FakeHTTPMedium()
-        request = SmartClientHTTPMediumRequest(medium)
+        request = http.SmartClientHTTPMediumRequest(medium)
         request.accept_bytes('abc')
         request.accept_bytes('def')
         self.assertEqual(None, medium.written_request)



More information about the bazaar-commits mailing list