Back to index

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

List of all members.

Public Member Functions

def runTest
def assertEqual

Static Public Attributes

string testdata
dictionary expected

Detailed Description

Definition at line 243 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))

Definition at line 262 of file parsertests.py.

00262 
00263     def runTest(self):
00264         stmts = pymake.parser.parsestring(self.testdata, 'VariableTest')
00265 
00266         m = pymake.data.Makefile()
00267         stmts.execute(m)
00268         for k, v in self.expected.iteritems():
00269             flavor, source, val = m.variables.get(k)
00270             if val is None:
00271                 self.assertEqual(val, v, 'variable named %s' % k)
00272             else:
00273                 self.assertEqual(val.resolvestr(m, m.variables), v, 'variable named %s' % k)

Here is the call graph for this function:


Member Data Documentation

dictionary parsertests.VariableTest.expected [static]
Initial value:
{'VAR': 'value',
                'VARNAME': 'newname',
                'TESTVAR': 'testvalue',
                'TESTVAL': 'moretesting',
                'IMM': 'TESTVAR ',
                'MULTIVAR': 'val1 val2',
                'UNDEF': None}

Definition at line 254 of file parsertests.py.

Initial value:
"""
VAR = value
VARNAME = TESTVAR
$(VARNAME) = testvalue
$(VARNAME:VAR=VAL) = moretesting
IMM := $(VARNAME) # this is a comment
MULTIVAR = val1 \\
  val2
VARNAME = newname
"""

Definition at line 244 of file parsertests.py.


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