~ubuntu-branches/ubuntu/hardy/python-docutils/hardy

« 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): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# Author: David Goodger
4
4
# Contact: goodger@users.sourceforge.net
5
 
# Revision: $Revision: 1.7 $
6
 
# Date: $Date: 2003/09/20 17:22:11 $
 
5
# Revision: $Revision: 3915 $
 
6
# Date: $Date: 2005-10-02 03:06:42 +0200 (Sun, 02 Oct 2005) $
7
7
# Copyright: This module has been placed in the public domain.
8
8
 
9
9
"""
51
51
        <substitution_reference refname="Omega">
52
52
            Omega
53
53
        ).
54
 
    <substitution_definition name="mdash">
 
54
    <substitution_definition names="mdash">
55
55
        \u2014
56
 
    <substitution_definition name="copy">
 
56
    <substitution_definition names="copy">
57
57
        \u00A9
58
 
    <substitution_definition name="nbsp">
 
58
    <substitution_definition names="nbsp">
59
59
        \u00A0
60
 
    <substitution_definition name="bne">
 
60
    <substitution_definition names="bne">
61
61
        =
62
62
        \u20e5
63
 
    <substitution_definition name="Omega">
 
63
    <substitution_definition names="Omega">
64
64
        \u03a9
65
65
"""],
66
66
["""
92
92
            Substitution definition "empty too" empty or invalid.
93
93
        <literal_block xml:space="preserve">
94
94
            .. |empty too| unicode:: .. comment doesn't count as content
95
 
    <substitution_definition name="not hex">
 
95
    <substitution_definition names="not\ hex">
96
96
        0xHEX
97
 
    <substitution_definition name="not all hex">
 
97
    <substitution_definition names="not\ all\ hex">
98
98
        UABCX
99
99
    <system_message level="3" line="8" source="test data" type="ERROR">
100
100
        <paragraph>
123
123
        <substitution_reference refname="BogusMegaCorp (TM)">
124
124
            BogusMegaCorp (TM)
125
125
        .
126
 
    <substitution_definition name="copy">
 
126
    <substitution_definition names="copy">
127
127
        \u00A9
128
 
    <substitution_definition name="BogusMegaCorp (TM)">
 
128
    <substitution_definition names="BogusMegaCorp\ (TM)">
129
129
        BogusMegaCorp
130
130
        \u2122
131
131
"""],
138
138
    <system_message level="3" line="2" source="test data" type="ERROR">
139
139
        <paragraph>
140
140
            Invalid character code: 0x111111111111111111
141
 
            %s
 
141
            ValueError: %s
142
142
        <literal_block xml:space="preserve">
143
143
            unicode:: 0x111111111111111111
144
144
    <system_message level="2" line="2" source="test data" type="WARNING">
157
157
            Substitution definition "too big for unicode" empty or invalid.
158
158
        <literal_block xml:space="preserve">
159
159
            .. |too big for unicode| unicode:: 0x11111111
160
 
""" % (DocutilsTestSupport.exception_data(
161
 
            'unichr(int("111111111111111111", 16))')[2],
 
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)],
162
166
       DocutilsTestSupport.exception_data('unichr(int("11111111", 16))')[2])]
163
167
]
164
168