File: test_fix_xrange_six.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 (50 lines) | stat: -rw-r--r-- 671 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from __future__ import generator_stop

from utils import check_on_input

RANGE = (
    """\
x = range(1)
""",
    """\
from __future__ import absolute_import
from six.moves import range
x = list(range(1))
""",
)

XRANGE = (
    """\
xrange(1)
""",
    """\
from __future__ import absolute_import
from six.moves import range
range(1)
""",
)

XRANGE_RANGE = (
    """\
x = xrange(1)
y = range(1)
""",
    """\
from __future__ import absolute_import
from six.moves import range
x = range(1)
y = list(range(1))
""",
)


def test_range():
    check_on_input(*RANGE)


def test_xrange():
    check_on_input(*XRANGE)


def test_xrange_range():
    check_on_input(*XRANGE_RANGE)