306
306
self.assertEqual(tests[1].transport_readonly_server, server2)
309
class TestInterRepositoryProviderAdapter(TestCase):
310
"""A group of tests that test the InterRepository test adapter."""
312
def test_adapted_tests(self):
313
# check that constructor parameters are passed through to the adapted
315
from bzrlib.repository import InterRepositoryTestProviderAdapter
316
input_test = TestInterRepositoryProviderAdapter(
317
"test_adapted_tests")
320
formats = [(str, "C1", "C2"), (str, "D1", "D2")]
321
adapter = InterRepositoryTestProviderAdapter(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].interrepo_class, formats[0][0])
326
self.assertEqual(tests[0].repository_format, formats[0][1])
327
self.assertEqual(tests[0].repository_format_to, formats[0][2])
328
self.assertEqual(tests[0].transport_server, server1)
329
self.assertEqual(tests[0].transport_readonly_server, server2)
330
self.assertEqual(tests[0].interrepo_class, formats[1][0])
331
self.assertEqual(tests[1].repository_format, formats[1][1])
332
self.assertEqual(tests[1].repository_format_to, formats[1][2])
333
self.assertEqual(tests[1].transport_server, server1)
334
self.assertEqual(tests[1].transport_readonly_server, server2)
309
337
class TestWorkingTreeProviderAdapter(TestCase):
310
338
"""A group of tests that test the workingtree implementation test adapter."""