~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

Nearly complete .bzr/checkout splitout.

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 TestWorkingTreeProviderAdapter(TestCase):
 
310
    """A group of tests that test the workingtree implementation 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.workingtree import WorkingTreeTestProviderAdapter
 
316
        input_test = TestWorkingTreeProviderAdapter(
 
317
            "test_adapted_tests")
 
318
        server1 = "a"
 
319
        server2 = "b"
 
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)
 
333
 
 
334
 
309
335
class TestTestCaseWithTransport(TestCaseWithTransport):
310
336
    """Tests for the convenience functions TestCaseWithTransport introduces."""
311
337