~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

Basic BzrDir support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
        self.assertEqual(tests[1].transport_readonly_server, server2)
231
231
 
232
232
 
 
233
class TestBzrDirProviderAdapter(TestCase):
 
234
    """A group of tests that test the bzr dir implementation test adapter."""
 
235
 
 
236
    def test_adapted_tests(self):
 
237
        # check that constructor parameters are passed through to the adapted
 
238
        # test.
 
239
        from bzrlib.bzrdir import BzrDirTestProviderAdapter
 
240
        input_test = TestBzrDirProviderAdapter(
 
241
            "test_adapted_tests")
 
242
        server1 = "a"
 
243
        server2 = "b"
 
244
        formats = ["c", "d"]
 
245
        adapter = BzrDirTestProviderAdapter(server1, server2, formats)
 
246
        suite = adapter.adapt(input_test)
 
247
        tests = list(iter(suite))
 
248
        self.assertEqual(2, len(tests))
 
249
        self.assertEqual(tests[0].bzrdir_format, formats[0])
 
250
        self.assertEqual(tests[0].transport_server, server1)
 
251
        self.assertEqual(tests[0].transport_readonly_server, server2)
 
252
        self.assertEqual(tests[1].bzrdir_format, formats[1])
 
253
        self.assertEqual(tests[1].transport_server, server1)
 
254
        self.assertEqual(tests[1].transport_readonly_server, server2)
 
255
 
 
256
 
233
257
class TestTestCaseWithTransport(TestCaseWithTransport):
234
258
    """Tests for the convenience functions TestCaseWithTransport introduces."""
235
259