Back to index

python3.2  3.2.2
Public Member Functions
lib2to3.tests.test_util.Test_touch_import Class Reference

List of all members.

Public Member Functions

def test_after_docstring
def test_after_imports
def test_beginning
def test_from_import
def test_name_import

Detailed Description

Definition at line 552 of file test_util.py.


Member Function Documentation

Definition at line 554 of file test_util.py.

00554 
00555     def test_after_docstring(self):
00556         node = parse('"""foo"""\nbar()')
00557         fixer_util.touch_import(None, "foo", node)
00558         self.assertEqual(str(node), '"""foo"""\nimport foo\nbar()\n\n')

Here is the call graph for this function:

Definition at line 559 of file test_util.py.

00559 
00560     def test_after_imports(self):
00561         node = parse('"""foo"""\nimport bar\nbar()')
00562         fixer_util.touch_import(None, "foo", node)
00563         self.assertEqual(str(node), '"""foo"""\nimport bar\nimport foo\nbar()\n\n')

Here is the call graph for this function:

Definition at line 564 of file test_util.py.

00564 
00565     def test_beginning(self):
00566         node = parse('bar()')
00567         fixer_util.touch_import(None, "foo", node)
00568         self.assertEqual(str(node), 'import foo\nbar()\n\n')

Here is the call graph for this function:

Definition at line 569 of file test_util.py.

00569 
00570     def test_from_import(self):
00571         node = parse('bar()')
00572         fixer_util.touch_import("html", "escape", node)
00573         self.assertEqual(str(node), 'from html import escape\nbar()\n\n')

Here is the call graph for this function:

Definition at line 574 of file test_util.py.

00574 
00575     def test_name_import(self):
00576         node = parse('bar()')
00577         fixer_util.touch_import(None, "cgi", node)
00578         self.assertEqual(str(node), 'import cgi\nbar()\n\n')

Here is the call graph for this function:


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