~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Robert Collins
  • Date: 2006-03-02 01:26:22 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060302012622-6d1d0b92fe94d9be
Checkpointing: created InterObject to factor out common inter object worker code, added InterVersionedFile and tests to allow making join work between any versionedfile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
334
334
        self.assertEqual(tests[1].transport_readonly_server, server2)
335
335
 
336
336
 
 
337
class TestInterVersionedFileProviderAdapter(TestCase):
 
338
    """A group of tests that test the InterVersionedFile test adapter."""
 
339
 
 
340
    def test_adapted_tests(self):
 
341
        # check that constructor parameters are passed through to the adapted
 
342
        # test.
 
343
        from bzrlib.versionedfile import InterVersionedFileTestProviderAdapter
 
344
        input_test = TestInterRepositoryProviderAdapter(
 
345
            "test_adapted_tests")
 
346
        server1 = "a"
 
347
        server2 = "b"
 
348
        formats = [(str, "C1", "C2"), (str, "D1", "D2")]
 
349
        adapter = InterVersionedFileTestProviderAdapter(server1, server2, formats)
 
350
        suite = adapter.adapt(input_test)
 
351
        tests = list(iter(suite))
 
352
        self.assertEqual(2, len(tests))
 
353
        self.assertEqual(tests[0].interversionedfile_class, formats[0][0])
 
354
        self.assertEqual(tests[0].versionedfile_factory, formats[0][1])
 
355
        self.assertEqual(tests[0].versionedfile_factory_to, formats[0][2])
 
356
        self.assertEqual(tests[0].transport_server, server1)
 
357
        self.assertEqual(tests[0].transport_readonly_server, server2)
 
358
        self.assertEqual(tests[0].interversionedfile_class, formats[1][0])
 
359
        self.assertEqual(tests[1].versionedfile_factory, formats[1][1])
 
360
        self.assertEqual(tests[1].versionedfile_factory_to, formats[1][2])
 
361
        self.assertEqual(tests[1].transport_server, server1)
 
362
        self.assertEqual(tests[1].transport_readonly_server, server2)
 
363
 
 
364
 
337
365
class TestWorkingTreeProviderAdapter(TestCase):
338
366
    """A group of tests that test the workingtree implementation test adapter."""
339
367