~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge_core.py

  • Committer: Martin Pool
  • Date: 2008-04-24 07:22:53 UTC
  • mto: This revision was merged to the branch mainline in revision 3415.
  • Revision ID: mbp@sourcefrog.net-20080424072253-opmjij7xfy38w27f
Remove every assert statement from bzrlib!

Depending on the context they are:

 * turned into an explicit if/raise of either AssertionError 
   or something more specific -- particularly where they protect
   programming interfaces, complex invariants, or data file integrity
 * removed, if they're redundant with a later check, not protecting
   a meaningful invariant
 * turned into a selftest method on tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
 
65
65
    def get_cset_path(self, parent, name):
66
66
        if name is None:
67
 
            assert (parent is None)
 
67
            if parent is not None:
 
68
                raise AssertionError()
68
69
            return None
69
70
        return pathjoin(self.cset.entries[parent].path, name)
70
71
 
90
91
            tt.apply()
91
92
            wt.commit('branch commit')
92
93
            wt.flush()
93
 
            assert len(wt.branch.revision_history()) == 2
 
94
            if len(wt.branch.revision_history()) != 2:
 
95
                raise AssertionError()
94
96
        self.this.branch.fetch(self.other.branch)
95
97
        other_basis = self.other.branch.basis_tree()
96
98
        merger = merge_type(self.this, self.this, self.base, other_basis,