~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

Merge in InterRepository api to have it available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
306
306
        self.assertEqual(tests[1].transport_readonly_server, server2)
307
307
 
308
308
 
 
309
class TestInterRepositoryProviderAdapter(TestCase):
 
310
    """A group of tests that test the InterRepository test adapter."""
 
311
 
 
312
    def test_adapted_tests(self):
 
313
        # check that constructor parameters are passed through to the adapted
 
314
        # test.
 
315
        from bzrlib.repository import InterRepositoryTestProviderAdapter
 
316
        input_test = TestInterRepositoryProviderAdapter(
 
317
            "test_adapted_tests")
 
318
        server1 = "a"
 
319
        server2 = "b"
 
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)
 
335
 
 
336
 
309
337
class TestWorkingTreeProviderAdapter(TestCase):
310
338
    """A group of tests that test the workingtree implementation test adapter."""
311
339