Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
lib2to3.tests.test_fixers.Test_numliterals Class Reference
Inheritance diagram for lib2to3.tests.test_fixers.Test_numliterals:
Inheritance graph
[legend]
Collaboration diagram for lib2to3.tests.test_fixers.Test_numliterals:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_octal_1
def test_long_int_1
def test_long_int_2
def test_long_hex
def test_comments_and_spacing
def test_unchanged_int
def test_unchanged_float
def test_unchanged_octal
def test_unchanged_hex
def test_unchanged_exp
def test_unchanged_complex_int
def test_unchanged_complex_float
def test_unchanged_complex_bare
def setUp
def check
def warns
def warns_unchanged
def unchanged
def assert_runs_after

Public Attributes

 refactor
 fixer_log
 filename

Static Public Attributes

string fixer = "numliterals"

Detailed Description

Definition at line 2674 of file test_fixers.py.


Member Function Documentation

def lib2to3.tests.test_fixers.FixerTestCase.assert_runs_after (   self,
  names 
) [inherited]

Definition at line 56 of file test_fixers.py.

00056 
00057     def assert_runs_after(self, *names):
00058         fixes = [self.fixer]
00059         fixes.extend(names)
00060         r = support.get_refactorer("lib2to3", fixes)
00061         (pre, post) = r.get_fixers()
00062         n = "fix_" + self.fixer
00063         if post and post[-1].__class__.__module__.endswith(n):
00064             # We're the last fixer to run
00065             return
00066         if pre and pre[-1].__class__.__module__.endswith(n) and not post:
00067             # We're the last in pre and post is empty
00068             return
00069         self.fail("Fixer run order (%s) is incorrect; %s should be last."\
00070                %(", ".join([x.__class__.__module__ for x in (pre+post)]), n))

Here is the call graph for this function:

def lib2to3.tests.test_fixers.FixerTestCase.check (   self,
  before,
  after,
  ignore_warnings = False 
) [inherited]

Definition at line 36 of file test_fixers.py.

00036 
00037     def check(self, before, after, ignore_warnings=False):
00038         tree = self._check(before, after)
00039         self.assertTrue(tree.was_changed)
00040         if not ignore_warnings:
00041             self.assertEqual(self.fixer_log, [])

Here is the call graph for this function:

def lib2to3.tests.test_fixers.FixerTestCase.setUp (   self,
  fix_list = None,
  fixer_pkg = "lib2to3",
  options = None 
) [inherited]

Definition at line 18 of file test_fixers.py.

00018 
00019     def setUp(self, fix_list=None, fixer_pkg="lib2to3", options=None):
00020         if fix_list is None:
00021             fix_list = [self.fixer]
00022         self.refactor = support.get_refactorer(fixer_pkg, fix_list, options)
00023         self.fixer_log = []
00024         self.filename = "<string>"
00025 
00026         for fixer in chain(self.refactor.pre_order,
00027                            self.refactor.post_order):
00028             fixer.log = self.fixer_log

Here is the caller graph for this function:

Definition at line 2697 of file test_fixers.py.

02697 
02698     def test_comments_and_spacing(self):
02699         b = """b =   0x12L"""
02700         a = """b =   0x12"""
02701         self.check(b, a)
02702 
02703         b = """b = 0755 # spam"""
02704         a = """b = 0o755 # spam"""
02705         self.check(b, a)

Here is the call graph for this function:

Definition at line 2692 of file test_fixers.py.

02692 
02693     def test_long_hex(self):
02694         b = """b = 0x12l"""
02695         a = """b = 0x12"""
02696         self.check(b, a)

Here is the call graph for this function:

Definition at line 2682 of file test_fixers.py.

02682 
02683     def test_long_int_1(self):
02684         b = """a = 12L"""
02685         a = """a = 12"""
02686         self.check(b, a)

Here is the call graph for this function:

Definition at line 2687 of file test_fixers.py.

02687 
02688     def test_long_int_2(self):
02689         b = """a = 12l"""
02690         a = """a = 12"""
02691         self.check(b, a)

Here is the call graph for this function:

Definition at line 2677 of file test_fixers.py.

02677 
02678     def test_octal_1(self):
02679         b = """0755"""
02680         a = """0o755"""
02681         self.check(b, a)

Here is the call graph for this function:

Definition at line 2734 of file test_fixers.py.

02734 
02735     def test_unchanged_complex_bare(self):
02736         s = """4j"""
02737         self.unchanged(s)
02738         s = """4.4j"""
02739         self.unchanged(s)

Here is the call graph for this function:

Definition at line 2730 of file test_fixers.py.

02730 
02731     def test_unchanged_complex_float(self):
02732         s = """5.4 + 4.9j"""
02733         self.unchanged(s)

Here is the call graph for this function:

Definition at line 2726 of file test_fixers.py.

02726 
02727     def test_unchanged_complex_int(self):
02728         s = """5 + 4j"""
02729         self.unchanged(s)

Here is the call graph for this function:

Definition at line 2722 of file test_fixers.py.

02722 
02723     def test_unchanged_exp(self):
02724         s = """5.0e10"""
02725         self.unchanged(s)

Here is the call graph for this function:

Definition at line 2710 of file test_fixers.py.

02710 
02711     def test_unchanged_float(self):
02712         s = """5.0"""
02713         self.unchanged(s)

Here is the call graph for this function:

Definition at line 2718 of file test_fixers.py.

02718 
02719     def test_unchanged_hex(self):
02720         s = """0xABC"""
02721         self.unchanged(s)

Here is the call graph for this function:

Definition at line 2706 of file test_fixers.py.

02706 
02707     def test_unchanged_int(self):
02708         s = """5"""
02709         self.unchanged(s)

Here is the call graph for this function:

Definition at line 2714 of file test_fixers.py.

02714 
02715     def test_unchanged_octal(self):
02716         s = """0o755"""
02717         self.unchanged(s)

Here is the call graph for this function:

def lib2to3.tests.test_fixers.FixerTestCase.unchanged (   self,
  before,
  ignore_warnings = False 
) [inherited]

Definition at line 51 of file test_fixers.py.

00051 
00052     def unchanged(self, before, ignore_warnings=False):
00053         self._check(before, before)
00054         if not ignore_warnings:
00055             self.assertEqual(self.fixer_log, [])

Here is the call graph for this function:

def lib2to3.tests.test_fixers.FixerTestCase.warns (   self,
  before,
  after,
  message,
  unchanged = False 
) [inherited]

Definition at line 42 of file test_fixers.py.

00042 
00043     def warns(self, before, after, message, unchanged=False):
00044         tree = self._check(before, after)
00045         self.assertTrue(message in "".join(self.fixer_log))
00046         if not unchanged:
00047             self.assertTrue(tree.was_changed)

Here is the call graph for this function:

Here is the caller graph for this function:

def lib2to3.tests.test_fixers.FixerTestCase.warns_unchanged (   self,
  before,
  message 
) [inherited]

Definition at line 48 of file test_fixers.py.

00048 
00049     def warns_unchanged(self, before, message):
00050         self.warns(before, before, message, unchanged=True)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented in lib2to3.tests.test_fixers.Test_import.

Definition at line 23 of file test_fixers.py.

Definition at line 2675 of file test_fixers.py.

Definition at line 22 of file test_fixers.py.

Definition at line 21 of file test_fixers.py.


The documentation for this class was generated from the following file: