/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-01-15 23:32:42 UTC
  • mfrom: (3942.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090115233242-4bxyn4zcj2a0ksfk
Fix log --short/--line FILE (Ian Clatworthy, #317417)

Show diffs side-by-side

added added

removed removed

Lines of Context:
909
909
        if not s.endswith(suffix):
910
910
            raise AssertionError('string %r does not end with %r' % (s, suffix))
911
911
 
912
 
    def assertContainsRe(self, haystack, needle_re):
 
912
    def assertContainsRe(self, haystack, needle_re, flags=0):
913
913
        """Assert that a contains something matching a regular expression."""
914
 
        if not re.search(needle_re, haystack):
 
914
        if not re.search(needle_re, haystack, flags):
915
915
            if '\n' in haystack or len(haystack) > 60:
916
916
                # a long string, format it in a more readable way
917
917
                raise AssertionError(
921
921
                raise AssertionError('pattern "%s" not found in "%s"'
922
922
                        % (needle_re, haystack))
923
923
 
924
 
    def assertNotContainsRe(self, haystack, needle_re):
 
924
    def assertNotContainsRe(self, haystack, needle_re, flags=0):
925
925
        """Assert that a does not match a regular expression"""
926
 
        if re.search(needle_re, haystack):
 
926
        if re.search(needle_re, haystack, flags):
927
927
            raise AssertionError('pattern "%s" found in "%s"'
928
928
                    % (needle_re, haystack))
929
929