~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Parth Malwankar
  • Date: 2010-07-08 05:28:17 UTC
  • mto: This revision was merged to the branch mainline in revision 5339.
  • Revision ID: parth.malwankar@gmail.com-20100708052817-s186712mhqyewmfq
updated re_compile_checked tests to handle deprecation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from bzrlib import (
29
29
    errors,
30
30
    osutils,
 
31
    symbol_versioning,
31
32
    tests,
32
33
    trace,
33
34
    win32utils,
1705
1706
 
1706
1707
class TestReCompile(tests.TestCase):
1707
1708
 
 
1709
    def _deprecated_re_compile_checked(self, *args, **kwargs):
 
1710
        return self.applyDeprecated(symbol_versioning.deprecated_in((2, 2, 0)),
 
1711
            osutils.re_compile_checked, *args, **kwargs)
 
1712
 
1708
1713
    def test_re_compile_checked(self):
1709
 
        r = osutils.re_compile_checked(r'A*', re.IGNORECASE)
 
1714
        r = self._deprecated_re_compile_checked(r'A*', re.IGNORECASE)
1710
1715
        self.assertTrue(r.match('aaaa'))
1711
1716
        self.assertTrue(r.match('aAaA'))
1712
1717
 
1714
1719
        # like https://bugs.launchpad.net/bzr/+bug/251352
1715
1720
        err = self.assertRaises(
1716
1721
            errors.BzrCommandError,
1717
 
            osutils.re_compile_checked, '*', re.IGNORECASE, 'test case')
 
1722
            self._deprecated_re_compile_checked, '*', re.IGNORECASE, 'test case')
1718
1723
        self.assertEqual(
1719
1724
            'Invalid regular expression in test case: '
1720
1725
            '"*" nothing to repeat',