~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_exceptions.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-11-06 16:36:47 UTC
  • mfrom: (5527.1.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20101106163647-vg3eg5y6huqmv6c2
(vila) Catch UnicodeError for optparse parsing (Rory Yorke)

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        self.assertContainsRe(err, r'Bazaar has encountered an internal error')
49
49
 
50
50
 
 
51
class TestOptParseBugHandling(TestCase):
 
52
    "Test that we handle http://bugs.python.org/issue2931"
 
53
 
 
54
    def test_nonascii_optparse(self):
 
55
        """Reasonable error raised when non-ascii in option name"""
 
56
        if sys.version_info < (2,5):
 
57
            error_re = 'no such option'
 
58
        else:
 
59
            error_re = 'Only ASCII permitted in option names'
 
60
        out = self.run_bzr_error([error_re], ['st',u'-\xe4'])
 
61
 
 
62
 
51
63
class TestDeprecationWarning(tests.TestCaseWithTransport):
52
64
    """The deprecation warning is controlled via a global variable:
53
65
    repository._deprecation_warning_done. As such, it can be emitted only once