/breezy/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/trunk

« back to all changes in this revision

Viewing changes to breezy/tests/test_lazy_regex.py

  • Committer: Jelmer Vernooij
  • Date: 2017-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    )
27
27
 
28
28
 
 
29
class ErrorTests(tests.TestCase):
 
30
 
 
31
    def test_invalid_pattern(self):
 
32
        error = lazy_regex.InvalidPattern('Bad pattern msg.')
 
33
        self.assertEqualDiff("Invalid pattern(s) found. Bad pattern msg.",
 
34
            str(error))
 
35
 
 
36
 
29
37
class InstrumentedLazyRegex(lazy_regex.LazyRegex):
30
38
    """Keep track of actions on the lazy regex"""
31
39
 
71
79
        p = lazy_regex.lazy_compile('RE:[')
72
80
        # As p.match is lazy, we make it into a lambda so its handled
73
81
        # by assertRaises correctly.
74
 
        e = self.assertRaises(errors.InvalidPattern, lambda: p.match('foo'))
 
82
        e = self.assertRaises(lazy_regex.InvalidPattern, lambda: p.match('foo'))
75
83
        self.assertEqual(e.msg, '"RE:[" unexpected end of regular expression')
76
84
 
77
85