~ubuntu-branches/ubuntu/jaunty/python-docutils/jaunty

« back to all changes in this revision

Viewing changes to test/test_parsers/test_rst/test_directives/test_unicode.py

  • Committer: Bazaar Package Importer
  • Author(s): Simon McVittie
  • Date: 2008-07-24 10:39:53 UTC
  • mfrom: (1.1.4 upstream) (3.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080724103953-8gh4uezg17g9ysgy
Tags: 0.5-2
* Upload docutils 0.5 to unstable
* Update rst.el to upstream Subversion r5596, which apparently fixes
  all its performance problems (17_speed_up_rst_el.dpatch, closes: #474941)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /usr/bin/env python
2
2
 
3
 
# Author: David Goodger
4
 
# Contact: goodger@users.sourceforge.net
5
 
# Revision: $Revision: 3915 $
6
 
# Date: $Date: 2005-10-02 03:06:42 +0200 (Sun, 02 Oct 2005) $
 
3
# $Id: test_unicode.py 4564 2006-05-21 20:44:42Z wiemann $
 
4
# Author: David Goodger <goodger@python.org>
7
5
# Copyright: This module has been placed in the public domain.
8
6
 
9
7
"""
18
16
    s.generateTests(totest)
19
17
    return s
20
18
 
 
19
unichr_exception = DocutilsTestSupport.exception_data(
 
20
    'unichr(int("111111111111111111", 16))')[0]
 
21
if isinstance(unichr_exception, OverflowError):
 
22
    unichr_exception_string = 'code too large (%s)' % unichr_exception
 
23
else:
 
24
    unichr_exception_string = str(unichr_exception)
 
25
 
21
26
totest = {}
22
27
 
23
28
totest['unicode'] = [
157
162
            Substitution definition "too big for unicode" empty or invalid.
158
163
        <literal_block xml:space="preserve">
159
164
            .. |too big for unicode| unicode:: 0x11111111
160
 
""" % ([DocutilsTestSupport.exception_data(
161
 
            'unichr(int("111111111111111111", 16))')[0],
162
 
        'code too large (%s)' % DocutilsTestSupport.exception_data(
163
 
    'unichr(int("111111111111111111", 16))')[0]]
164
 
       [isinstance(DocutilsTestSupport.exception_data(
165
 
    'unichr(int("111111111111111111", 16))')[0], OverflowError)],
 
165
""" % (unichr_exception_string,
166
166
       DocutilsTestSupport.exception_data('unichr(int("11111111", 16))')[2])]
167
167
]
168
168