~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_diff.py

  • Committer: John Arbash Meinel
  • Date: 2007-12-04 16:28:28 UTC
  • mto: This revision was merged to the branch mainline in revision 3131.
  • Revision ID: john@arbash-meinel.com-20071204162828-chfnl5ylzkh0y2ll
Enable some error checking, and small amount of code cleanup.
If PyObject_Hash() or PyObject_Length() fails, we should raise an exception, not
silently swallow it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1079
1079
        self._PatienceSequenceMatcher = \
1080
1080
            bzrlib._patiencediff_c.PatienceSequenceMatcher_c
1081
1081
 
 
1082
    def test_unhashable(self):
 
1083
        """We should get a proper exception here."""
 
1084
        # A sub-list is unhashable
 
1085
        e = self.assertRaises(TypeError, self._PatienceSequenceMatcher,
 
1086
                                         None, [[]], [])
 
1087
 
 
1088
    def test_no_length(self):
 
1089
        # Objects have no length
 
1090
        e = self.assertRaises(TypeError, self._PatienceSequenceMatcher,
 
1091
                                         None, [object()], [])
 
1092
 
1082
1093
 
1083
1094
class TestPatienceDiffLibFiles(TestCaseInTempDir):
1084
1095