306
306
self.assertEqual(tests[1].transport_readonly_server, server2)
309
class TestWorkingTreeProviderAdapter(TestCase):
310
"""A group of tests that test the workingtree implementation test adapter."""
312
def test_adapted_tests(self):
313
# check that constructor parameters are passed through to the adapted
315
from bzrlib.workingtree import WorkingTreeTestProviderAdapter
316
input_test = TestWorkingTreeProviderAdapter(
317
"test_adapted_tests")
320
formats = [("c", "C"), ("d", "D")]
321
adapter = WorkingTreeTestProviderAdapter(server1, server2, formats)
322
suite = adapter.adapt(input_test)
323
tests = list(iter(suite))
324
self.assertEqual(2, len(tests))
325
self.assertEqual(tests[0].workingtree_format, formats[0][0])
326
self.assertEqual(tests[0].bzrdir_format, formats[0][1])
327
self.assertEqual(tests[0].transport_server, server1)
328
self.assertEqual(tests[0].transport_readonly_server, server2)
329
self.assertEqual(tests[1].workingtree_format, formats[1][0])
330
self.assertEqual(tests[1].bzrdir_format, formats[1][1])
331
self.assertEqual(tests[1].transport_server, server1)
332
self.assertEqual(tests[1].transport_readonly_server, server2)
309
335
class TestTestCaseWithTransport(TestCaseWithTransport):
310
336
"""Tests for the convenience functions TestCaseWithTransport introduces."""