Package formulaparser :: Package test :: Module testsuite :: Class ParserTestSuite
[show private | hide private]
[frames | no frames]

Type ParserTestSuite

object --+    
         |    
  TestCase --+
             |
            ParserTestSuite


Testing various patterns that should be recognized
Method Summary
  testASTComplexExpressionSuccess(self)
Testing that a formula returns the expected AST
  testASTFailure(self)
Testing AST for failure
  testASTSanity(self)
Testing AST for sanity
  testASTSimpleExpressionSuccess(self)
Testing the AST by evaluating simple arithmetic expressions
  testASTSuccess(self)
Testing AST for success
    Inherited from TestCase
  __init__(self, methodName)
Create an instance of the class that will use the named test method when executed.
  __call__(self, result)
  __repr__(self)
  __str__(self)
  assert_(self, expr, msg)
Fail the test unless the expression is true.
  assertAlmostEqual(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertAlmostEquals(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertEqual(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  assertEquals(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  assertNotAlmostEqual(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertNotAlmostEquals(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertNotEqual(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  assertNotEquals(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  assertRaises(self, excClass, callableObj, *args, **kwargs)
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs.
  countTestCases(self)
  debug(self)
Run the test without collecting errors in a TestResult
  defaultTestResult(self)
  fail(self, msg)
Fail immediately, with the given message.
  failIf(self, expr, msg)
Fail the test if the expression is true.
  failIfAlmostEqual(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  failIfEqual(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  failUnless(self, expr, msg)
Fail the test unless the expression is true.
  failUnlessAlmostEqual(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  failUnlessEqual(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  failUnlessRaises(self, excClass, callableObj, *args, **kwargs)
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs.
  id(self)
  run(self, result)
  setUp(self)
Hook method for setting up the test fixture before exercising it.
  shortDescription(self)
Returns a one-line description of the test, or None if no description has been provided.
  tearDown(self)
Hook method for deconstructing the test fixture after testing it.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Class Variable Summary
list complexExprSamples = [('=MAX(2,3,4,5)/$A$3;', <ast.Funct...
list formulaFailureSamples = ['=', '34', '=3+4', '=A1:A5;', '...
list formulaSuccessSamples = [('=((4));', '=((4))'), ('=4+3+m...
list simpleExprSamples = [('=-((4))+3+7+2-1;', 7), ('=-4;', -...

Method Details

testASTComplexExpressionSuccess(self)

Testing that a formula returns the expected AST

testASTFailure(self)

Testing AST for failure

testASTSanity(self)

Testing AST for sanity

testASTSimpleExpressionSuccess(self)

Testing the AST by evaluating simple arithmetic expressions

testASTSuccess(self)

Testing AST for success

Class Variable Details

complexExprSamples

Type:
list
Value:
[('=MAX(2,3,4,5)/$A$3;', <ast.Function.Function instance at 0xf6c4f2cc\
>),
 ('=MIN(4+3,2)*2^3;', <ast.Function.Function instance at 0xf6c4f32c>),
 ('=A5+4-2*2;', <ast.Function.Function instance at 0xf6c4f46c>),
 ('=$A100^2+BB$38*2+MIN(A1:A5);',
  <ast.Function.Function instance at 0xf6c4f64c>)]                     

formulaFailureSamples

Type:
list
Value:
['=',
 '34',
 '=3+4',
 '=A1:A5;',
 '=f(A1:A5+4);',
 '=--5;',
 '=zxy;',
 '=AA;',
...                                                                    

formulaSuccessSamples

Type:
list
Value:
[('=((4));', '=((4))'),
 ('=4+3+min(A1:A5);', '=4+3+min(A1:A5)'),
 ('=4;', '=4'),
 ('=sum(3,4,A1);', '=3+4+A1'),
 ('=f(A1:A4,34)+g();', '=f(A1:A4,34)+g()'),
 ('=(3+2+3)^(2+3);', '=(3+2+3)^(2+3)'),
 ('=((23+A1+(34))+23);', '=((23+A1+(34))+23)'),
 ('=(A1)+((sum(3,4)));', '=(A1)+((3+4))'),
...                                                                    

simpleExprSamples

Type:
list
Value:
[('=-((4))+3+7+2-1;', 7),
 ('=-4;', -4.0),
 ('=4.324;', 4.3239999999999998),
 ('=(4);', 4),
 ('=4+3;', 7),
 ('=4-3;', 1),
 ('=(4-3);', 1),
 ('=4*3;', 12),
...                                                                    

Generated by Epydoc 2.1 on Thu Aug 26 22:55:24 2004 http://epydoc.sf.net