File: test_fix_unicode_type.py

package info (click to toggle)
modernize 0.9-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 416 kB
  • sloc: python: 2,016; makefile: 145
file content (33 lines) | stat: -rw-r--r-- 507 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from __future__ import generator_stop

from utils import check_on_input

UNICODE_TYPE_REF = (
    """\
isinstance(u'str', unicode)
""",
    """\
from __future__ import absolute_import
import six
isinstance(u'str', six.text_type)
""",
)

UNICODE_TYPE_CALL = (
    """\
unicode(x)
""",
    """\
from __future__ import absolute_import
import six
six.text_type(x)
""",
)


def test_unicode_type_ref():
    check_on_input(*UNICODE_TYPE_REF)


def test_unicode_type_call():
    check_on_input(*UNICODE_TYPE_CALL)