~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-23 17:00:36 UTC
  • mfrom: (4032.1.4 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090223170036-3q1v68ewdt8i0to5
(Marius Kruger) Remove all trailing whitespace and add tests to
        enforce this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
"""Repository implementation tests for bzr.
21
21
 
22
22
These test the conformance of all the repository variations to the expected API.
23
 
Specific tests for individual formats are in the tests/test_repository.py file 
 
23
Specific tests for individual formats are in the tests/test_repository.py file
24
24
rather than in tests/branch_implementations/*.py.
25
25
"""
26
26
 
56
56
 
57
57
    :param formats: A list of (scenario_name_suffix, repo_format)
58
58
        where the scenario_name_suffix is to be appended to the format
59
 
        name, and the repo_format is a RepositoryFormat subclass 
 
59
        name, and the repo_format is a RepositoryFormat subclass
60
60
        instance.
61
61
    :returns: Scenarios of [(scenario_name, {parameter_name: value})]
62
62
    """
138
138
            of the file is verified to have the given parents after the
139
139
            reconcile.  i.e. this is used to assert that reconcile made the
140
140
            changes we expect it to make.
141
 
    
 
141
 
142
142
    A subclass may define the following optional method as well:
143
143
        :corrected_fulltexts: a list of file versions that should be stored as
144
144
            fulltexts (not deltas) after reconcile.  run_test will verify that
213
213
class FileParentIsNotInRevisionAncestryScenario(BrokenRepoScenario):
214
214
    """A scenario where a revision 'rev2' has 'a-file' with a
215
215
    parent 'rev1b' that is not in the revision ancestry.
216
 
    
 
216
 
217
217
    Reconcile should remove 'rev1b' from the parents list of 'a-file' in
218
218
    'rev2', preserving 'rev1a' as a parent.
219
219
    """
633
633
        inv = self.make_one_file_inventory(
634
634
            repo, 'bad-parent', (), root_revision='bad-parent')
635
635
        self.add_revision(repo, 'bad-parent', inv, ())
636
 
        
 
636
 
637
637
        inv = self.make_one_file_inventory(
638
638
            repo, 'good-parent', ('bad-parent',))
639
639
        self.add_revision(repo, 'good-parent', inv, ('bad-parent',))
640
 
        
 
640
 
641
641
        inv = self.make_one_file_inventory(
642
642
            repo, 'broken-revision', ('good-parent', 'bad-parent'))
643
643
        self.add_revision(repo, 'broken-revision', inv, ('good-parent',))
653
653
                       ('a-file-id', 'broken-revision'): True,
654
654
                       ('a-file-id', 'good-parent'): True})
655
655
        return result
656
 
             
 
656
 
657
657
    def repository_text_keys(self):
658
658
        return {('a-file-id', 'bad-parent'): [NULL_REVISION],
659
659
                ('a-file-id', 'broken-revision'):
744
744
                    [('TREE_ROOT', 'modified-something-else')],
745
745
                ('TREE_ROOT', 'modified-something-else'):
746
746
                    [('TREE_ROOT', 'basis')]}
747
 
            
 
747
 
748
748
 
749
749
class IncorrectlyOrderedParentsScenario(BrokenRepoScenario):
750
750
    """A scenario where the set parents of a version of a file are correct, but
838
838
                    [('TREE_ROOT', 'parent-2'), ('TREE_ROOT', 'parent-1')],
839
839
                ('TREE_ROOT', 'parent-1'): [NULL_REVISION],
840
840
                ('TREE_ROOT', 'parent-2'): [NULL_REVISION]}
841
 
               
 
841
 
842
842
 
843
843
all_broken_scenario_classes = [
844
844
    UndamagedRepositoryScenario,