~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Robert Collins
  • Date: 2006-07-20 13:00:31 UTC
  • mto: (1852.9.1 Tree.compare().)
  • mto: This revision was merged to the branch mainline in revision 1890.
  • Revision ID: robertc@robertcollins.net-20060720130031-d26103a427ea10f3
StartĀ treeĀ implementationĀ tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1842
1842
        self._transport_readonly_server = transport_readonly_server
1843
1843
        self._formats = formats
1844
1844
    
 
1845
    def _clone_test(self, test, bzrdir_format, workingtree_format, variation):
 
1846
        """Clone test for adaption."""
 
1847
        new_test = deepcopy(test)
 
1848
        new_test.transport_server = self._transport_server
 
1849
        new_test.transport_readonly_server = self._transport_readonly_server
 
1850
        new_test.bzrdir_format = bzrdir_format
 
1851
        new_test.workingtree_format = workingtree_format
 
1852
        def make_new_test_id():
 
1853
            new_id = "%s(%s)" % (test.id(), variation)
 
1854
            return lambda: new_id
 
1855
        new_test.id = make_new_test_id()
 
1856
        return new_test
 
1857
    
1845
1858
    def adapt(self, test):
1846
1859
        from bzrlib.tests import TestSuite
1847
1860
        result = TestSuite()
1848
1861
        for workingtree_format, bzrdir_format in self._formats:
1849
 
            new_test = deepcopy(test)
1850
 
            new_test.transport_server = self._transport_server
1851
 
            new_test.transport_readonly_server = self._transport_readonly_server
1852
 
            new_test.bzrdir_format = bzrdir_format
1853
 
            new_test.workingtree_format = workingtree_format
1854
 
            def make_new_test_id():
1855
 
                new_id = "%s(%s)" % (new_test.id(), workingtree_format.__class__.__name__)
1856
 
                return lambda: new_id
1857
 
            new_test.id = make_new_test_id()
 
1862
            new_test = self._clone_test(
 
1863
                test,
 
1864
                bzrdir_format,
 
1865
                workingtree_format, workingtree_format.__class__.__name__)
1858
1866
            result.addTest(new_test)
1859
1867
        return result