Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_shlex.ShlexTest Class Reference

List of all members.

Public Member Functions

def setUp
def splitTest
def oldSplit
def testSplitPosix
def testCompat

Public Attributes

 data
 posix_data

Detailed Description

Definition at line 137 of file test_shlex.py.


Member Function Documentation

def test.test_shlex.ShlexTest.oldSplit (   self,
  s 
)

Definition at line 155 of file test_shlex.py.

00155 
00156     def oldSplit(self, s):
00157         ret = []
00158         lex = shlex.shlex(io.StringIO(s))
00159         tok = lex.get_token()
00160         while tok:
00161             ret.append(tok)
00162             tok = lex.get_token()
00163         return ret

Here is the caller graph for this function:

Definition at line 138 of file test_shlex.py.

00138 
00139     def setUp(self):
00140         self.data = [x.split("|")[:-1]
00141                      for x in data.splitlines()]
00142         self.posix_data = [x.split("|")[:-1]
00143                            for x in posix_data.splitlines()]
00144         for item in self.data:
00145             item[0] = item[0].replace(r"\n", "\n")
00146         for item in self.posix_data:
00147             item[0] = item[0].replace(r"\n", "\n")

Here is the caller graph for this function:

def test.test_shlex.ShlexTest.splitTest (   self,
  data,
  comments 
)

Definition at line 148 of file test_shlex.py.

00148 
00149     def splitTest(self, data, comments):
00150         for i in range(len(data)):
00151             l = shlex.split(data[i][0], comments=comments)
00152             self.assertEqual(l, data[i][1:],
00153                              "%s: %s != %s" %
00154                              (data[i][0], l, data[i][1:]))

Here is the call graph for this function:

Here is the caller graph for this function:

Test compatibility interface

Definition at line 168 of file test_shlex.py.

00168 
00169     def testCompat(self):
00170         """Test compatibility interface"""
00171         for i in range(len(self.data)):
00172             l = self.oldSplit(self.data[i][0])
00173             self.assertEqual(l, self.data[i][1:],
00174                              "%s: %s != %s" %
00175                              (self.data[i][0], l, self.data[i][1:]))
00176 
# Allow this test to be used with old shlex.py

Here is the call graph for this function:

Test data splitting with posix parser

Definition at line 164 of file test_shlex.py.

00164 
00165     def testSplitPosix(self):
00166         """Test data splitting with posix parser"""
00167         self.splitTest(self.posix_data, comments=True)

Here is the call graph for this function:


Member Data Documentation

Definition at line 139 of file test_shlex.py.

Definition at line 141 of file test_shlex.py.


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