Rev 5037: Move TestingChrootServer to bzrlib.tests.test_server in file:///home/vila/src/bzr/cleanup/test-servers/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Feb 9 20:41:54 GMT 2010


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

------------------------------------------------------------
revno: 5037
revision-id: v.ladeuil+lp at free.fr-20100209204154-602h8yh3px1xhc6d
parent: v.ladeuil+lp at free.fr-20100209203343-ktxx7t0xvptvjnt1
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: test-servers
timestamp: Tue 2010-02-09 21:41:54 +0100
message:
  Move TestingChrootServer to bzrlib.tests.test_server
-------------- next part --------------
=== modified file 'bzrlib/tests/test_server.py'
--- a/bzrlib/tests/test_server.py	2010-02-09 20:33:43 +0000
+++ b/bzrlib/tests/test_server.py	2010-02-09 20:41:54 +0000
@@ -19,6 +19,7 @@
     urlutils,
     )
 from bzrlib.transport import (
+    chroot,
     pathfilter,
     )
 from bzrlib.smart import server
@@ -212,7 +213,8 @@
 class TestingPathFilteringServer(pathfilter.PathFilteringServer):
 
     def __init__(self):
-        """TestingChrootServer is not usable until start_server is called."""
+        """TestingPathFilteringServer is not usable until start_server
+        is called."""
 
     def start_server(self, backing_server=None):
         """Setup the Chroot on backing_server."""
@@ -225,6 +227,28 @@
         self.filter_func = lambda x: 'added-by-filter/' + x
         super(TestingPathFilteringServer, self).start_server()
 
+    def get_bogus_url(self):
+        raise NotImplementedError
+
+
+class TestingChrootServer(chroot.ChrootServer):
+
+    def __init__(self):
+        """TestingChrootServer is not usable until start_server is called."""
+        super(TestingChrootServer, self).__init__(None)
+
+    def start_server(self, backing_server=None):
+        """Setup the Chroot on backing_server."""
+        if backing_server is not None:
+            self.backing_transport = transport.get_transport(
+                backing_server.get_url())
+        else:
+            self.backing_transport = transport.get_transport('.')
+        super(TestingChrootServer, self).start_server()
+
+    def get_bogus_url(self):
+        raise NotImplementedError
+
 
 class SmartTCPServer_for_testing(server.SmartTCPServer):
     """Server suitable for use by transport tests.

=== modified file 'bzrlib/transport/chroot.py'
--- a/bzrlib/transport/chroot.py	2010-01-07 03:03:01 +0000
+++ b/bzrlib/transport/chroot.py	2010-02-09 20:41:54 +0000
@@ -65,21 +65,7 @@
         return self._relpath_from_server_root(relpath)
 
 
-class TestingChrootServer(ChrootServer):
-
-    def __init__(self):
-        """TestingChrootServer is not usable until start_server is called."""
-        ChrootServer.__init__(self, None)
-
-    def start_server(self, backing_server=None):
-        """Setup the Chroot on backing_server."""
-        if backing_server is not None:
-            self.backing_transport = get_transport(backing_server.get_url())
-        else:
-            self.backing_transport = get_transport('.')
-        ChrootServer.start_server(self)
-
-
 def get_test_permutations():
     """Return the permutations to be used in testing."""
-    return [(ChrootTransport, TestingChrootServer)]
+    from bzrlib.tests import test_server
+    return [(ChrootTransport, test_server.TestingChrootServer)]



More information about the bazaar-commits mailing list