~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/chroot.py

  • Committer: Andrew Bennetts
  • Date: 2010-01-13 23:16:20 UTC
  • mfrom: (4957 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4960.
  • Revision ID: andrew.bennetts@canonical.com-20100113231620-n6in2yjib2v6z03g
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2009 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
65
65
        return self._relpath_from_server_root(relpath)
66
66
 
67
67
 
 
68
class TestingChrootServer(ChrootServer):
 
69
 
 
70
    def __init__(self):
 
71
        """TestingChrootServer is not usable until start_server is called."""
 
72
        ChrootServer.__init__(self, None)
 
73
 
 
74
    def start_server(self, backing_server=None):
 
75
        """Setup the Chroot on backing_server."""
 
76
        if backing_server is not None:
 
77
            self.backing_transport = get_transport(backing_server.get_url())
 
78
        else:
 
79
            self.backing_transport = get_transport('.')
 
80
        ChrootServer.start_server(self)
 
81
 
 
82
 
68
83
def get_test_permutations():
69
84
    """Return the permutations to be used in testing."""
70
 
    from bzrlib.tests import test_server
71
 
    return [(ChrootTransport, test_server.TestingChrootServer)]
 
85
    return [(ChrootTransport, TestingChrootServer)]