Back to index

enigmail  1.4.3
Public Member Functions | Static Public Attributes
parsertests.MakeSyntaxTest Class Reference
Inheritance diagram for parsertests.MakeSyntaxTest:
Inheritance graph
[legend]
Collaboration diagram for parsertests.MakeSyntaxTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def compareRecursive
def runSingle
def assertEqual

Static Public Attributes

dictionary testdata

Detailed Description

Definition at line 166 of file parsertests.py.


Member Function Documentation

def parsertests.TestBase.assertEqual (   self,
  a,
  b,
  msg = "" 
) [inherited]
Actually print the values which weren't equal, if things don't work out!

Definition at line 16 of file parsertests.py.

00016 
00017     def assertEqual(self, a, b, msg=""):
00018         """Actually print the values which weren't equal, if things don't work out!"""
00019         unittest.TestCase.assertEqual(self, a, b, "%s got %r expected %r" % (msg, a, b))

def parsertests.MakeSyntaxTest.compareRecursive (   self,
  actual,
  expected,
  path 
)

Definition at line 207 of file parsertests.py.

00207 
00208     def compareRecursive(self, actual, expected, path):
00209         self.assertEqual(len(actual), len(expected),
00210                          "compareRecursive: %s %r" % (path, actual))
00211         for i in xrange(0, len(actual)):
00212             ipath = path + [i]
00213 
00214             a, isfunc = actual[i]
00215             e = expected[i]
00216             if isinstance(e, str):
00217                 self.assertEqual(a, e, "compareRecursive: %s" % (ipath,))
00218             else:
00219                 self.assertEqual(type(a), getattr(pymake.functions, e['type']),
00220                                  "compareRecursive: %s" % (ipath,))
00221                 for k, v in e.iteritems():
00222                     if k == 'type':
00223                         pass
00224                     elif k[0] == '[':
00225                         item = int(k[1:-1])
00226                         proppath = ipath + [item]
00227                         self.compareRecursive(a[item], v, proppath)
00228                     elif k[0] == '.':
00229                         item = k[1:]
00230                         proppath = ipath + [item]
00231                         self.compareRecursive(getattr(a, item), v, proppath)
00232                     else:
00233                         raise Exception("Unexpected property at %s: %s" % (ipath, k))

Here is the call graph for this function:

Here is the caller graph for this function:

def parsertests.MakeSyntaxTest.runSingle (   self,
  s,
  startat,
  stopat,
  stopoffset,
  expansion 
)

Definition at line 234 of file parsertests.py.

00234 
00235     def runSingle(self, s, startat, stopat, stopoffset, expansion):
00236         d = pymake.parser.Data.fromstring(s, pymake.parserdata.Location('testdata', 1, 0))
00237 
00238         a, t, offset = pymake.parser.parsemakesyntax(d, startat, stopat, pymake.parser.itermakefilechars)
00239         self.compareRecursive(a, expansion, [])
00240         self.assertEqual(offset, stopoffset)
00241 
00242 multitest(MakeSyntaxTest)

Here is the call graph for this function:


Member Data Documentation

Definition at line 168 of file parsertests.py.


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