(self)
| 56 | class TestAutojunk(unittest.TestCase): |
| 57 | """Tests for the autojunk parameter added in 2.7""" |
| 58 | def test_one_insert_homogenous_sequence(self): |
| 59 | # By default autojunk=True and the heuristic kicks in for a sequence |
| 60 | # of length 200+ |
| 61 | seq1 = 'b' * 200 |
| 62 | seq2 = 'a' + 'b' * 200 |
| 63 | |
| 64 | sm = difflib.SequenceMatcher(None, seq1, seq2) |
| 65 | self.assertAlmostEqual(sm.ratio(), 0, places=3) |
| 66 | self.assertEqual(sm.bpopular, {'b'}) |
| 67 | |
| 68 | # Now turn the heuristic off |
| 69 | sm = difflib.SequenceMatcher(None, seq1, seq2, autojunk=False) |
| 70 | self.assertAlmostEqual(sm.ratio(), 0.9975, places=3) |
| 71 | self.assertEqual(sm.bpopular, set()) |
| 72 | |
| 73 | |
| 74 | class TestSFbugs(unittest.TestCase): |
nothing calls this directly
no test coverage detected