~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lazy_regex.py

  • Committer: Martin Pool
  • Date: 2010-08-05 08:18:06 UTC
  • mto: (5050.3.20 2.2)
  • mto: This revision was merged to the branch mainline in revision 5371.
  • Revision ID: mbp@sourcefrog.net-20100805081806-4c4gjsiw9i3j0c3w
Clear off progress bars by painting spaces.

This selectively reverts part of the previous progress change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import re
20
20
 
 
21
from bzrlib import errors
21
22
from bzrlib import (
22
23
    lazy_regex,
23
24
    tests,
63
64
                          ('_real_re_compile', ('foo',), {}),
64
65
                         ], actions)
65
66
 
 
67
    def test_bad_pattern(self):
 
68
        """Ensure lazy regex handles bad patterns cleanly."""
 
69
        p = lazy_regex.lazy_compile('RE:[')
 
70
        # As p.match is lazy, we make it into a lambda so its handled
 
71
        # by assertRaises correctly.
 
72
        e = self.assertRaises(errors.InvalidPattern, lambda: p.match('foo'))
 
73
        self.assertEqual(e.msg, '"RE:[" unexpected end of regular expression')
 
74
 
66
75
 
67
76
class TestLazyCompile(tests.TestCase):
68
77