1842
1842
self._transport_readonly_server = transport_readonly_server
1843
1843
self._formats = formats
1845
def _clone_test(self, test, bzrdir_format, workingtree_format, variation):
1846
"""Clone test for adaption."""
1847
new_test = deepcopy(test)
1848
new_test.transport_server = self._transport_server
1849
new_test.transport_readonly_server = self._transport_readonly_server
1850
new_test.bzrdir_format = bzrdir_format
1851
new_test.workingtree_format = workingtree_format
1852
def make_new_test_id():
1853
new_id = "%s(%s)" % (test.id(), variation)
1854
return lambda: new_id
1855
new_test.id = make_new_test_id()
1845
1858
def adapt(self, test):
1846
1859
from bzrlib.tests import TestSuite
1847
1860
result = TestSuite()
1848
1861
for workingtree_format, bzrdir_format in self._formats:
1849
new_test = deepcopy(test)
1850
new_test.transport_server = self._transport_server
1851
new_test.transport_readonly_server = self._transport_readonly_server
1852
new_test.bzrdir_format = bzrdir_format
1853
new_test.workingtree_format = workingtree_format
1854
def make_new_test_id():
1855
new_id = "%s(%s)" % (new_test.id(), workingtree_format.__class__.__name__)
1856
return lambda: new_id
1857
new_test.id = make_new_test_id()
1862
new_test = self._clone_test(
1865
workingtree_format, workingtree_format.__class__.__name__)
1858
1866
result.addTest(new_test)