simpleparse.tests.test_grammarparser
index
s:\sp\simpleparse\tests\test_grammarparser.py

Tests that simpleparsegrammar does parse SimpleParse grammars

 
Modules
            
mx.TextTools.TextTools
pprint
unittest
 
Classes
            
unittest.TestCase
SimpleParseGrammarTests
SimpleParseRecursiveTests
 
class SimpleParseGrammarTests(unittest.TestCase)
      Test parsing of the the simpleparse grammar elements
 
   Methods defined here:
doBasicTest(self, parserName, testValue, expected)
testChar1(self)
testChar2(self)
testChar3(self)
testChar4(self)
testChar5(self)
testChar6(self)
testChar7(self)
testChar8(self)
testChar85(self)
testChar9(self)
testCharNoBrace1(self)
testCharRange1(self)
testComment1(self)
testComment2(self)
testCutToken2(self)
testCutToken3(self)
testCutToken4(self)
testDeclaration(self)
testDeclaration2(self)
testDeclaration3(self)
testDeclaration4(self)
testDeclaration5(self)
testDeclarationSet1(self)
testDeclarationSet2(self)
Just tries to parse and sees that everything was parsed, doesn't predict the result
testElementToken1(self)
testElementToken2(self)
testElementToken3(self)
testElementToken4(self)
testElementToken5(self)
testElementToken6(self)
Lookahead indicator with positive
testElementToken7(self)
Lookahead indicator with negative
testElementToken8(self)
Error on fail indicator
testElementToken9(self)
Error on fail indicator with message
testErrorOnFailFlag1(self)
testExpandedName1(self)
testExpandedName2(self)
testFOGroup1(self)
testGroup1(self)
testGroup2(self)
testGroup3(self)
Test group with sequential added group
Note that this test also serves to test
the function of non-reporting names
testGroup4(self)
Test group with sequential added group
Note that this test also serves to test
the function of non-reporting names
testGroup5(self)
Test group with sequential added group
Note that this test also serves to test
the function of non-reporting names
testGroup6(self)
Test group with multiple / 'd values
testLiteral1(self)
testLiteral2(self)
testLiteral3(self)
testLiteral4(self)
testLiteral5(self)
testLiteral6(self)
testLiteralDecorator(self)
testLiteralDecorator2(self)
testLiteralDecorator3(self)
Decorator must be right next to literal, no whitespace
testLookAheadIndicator1(self)
testLookAheadIndicator2(self)
testName1(self)
testName2(self)
testName3(self)
testNegposIndicator1(self)
testNegposIndicator2(self)
testOccurenceIndicator1(self)
testOccurenceIndicator2(self)
testOccurenceIndicator3(self)
testOccurenceIndicator4(self)
testOccurenceIndicator5(self)
testRange1(self)
testRange2(self)
testRange3(self)
testRange4(self)
Test optional repeating children running into eof
 
Original SimpleParse had a major failure here,
system hung trying to parse the [] string.  Basically,
there was no check for EOF during a repeating-item
parse (save for literals and character sets), so you
wound up with infinite loops.
testRange5(self)
Test optional repeating children with no termination
 
Original SimpleParse had a major failure here,
system hung trying to parse the [] string.  Basically,
there was no check for EOF during a repeating-item
parse (save for literals and character sets), so you
wound up with infinite loops.
testSEQGroup1(self)
testSEQToken1(self)
testSeqGroup2(self)
testUnreportedName1(self)
testUnreportedName2(self)
testWhitespace1(self)
testWhitespace2(self)
testWhitespace3(self)
testWhitespace4(self)
testWhitespace5(self)
Bug in 2.0.0 where Null comments such as:
                "#
"
 
                didn't parse.

Data and non-method functions defined here:
__doc__ = 'Test parsing of the the simpleparse grammar elements'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'simpleparse.tests.test_grammarparser'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from unittest.TestCase:
_TestCase__exc_info = __exc_info(self)
Return a version of sys.exc_info() with the traceback frame
minimised; usually the top level of the traceback frame is not
needed.
__call__(self, result=None)
__init__(self, methodName='runTest')
Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
__repr__(self)
__str__(self)
assertEqual = failUnlessEqual(self, first, second, msg=None)
Fail if the two objects are unequal as determined by the '!='
operator.
assertEquals = failUnlessEqual(self, first, second, msg=None)
Fail if the two objects are unequal as determined by the '!='
operator.
assertNotEqual = failIfEqual(self, first, second, msg=None)
Fail if the two objects are equal as determined by the '=='
operator.
assertNotEquals = failIfEqual(self, first, second, msg=None)
Fail if the two objects are equal as determined by the '=='
operator.
assertRaises = 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. If a different type of exception is
thrown, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.
assert_ = failUnless(self, expr, msg=None)
Fail the test unless the expression is true.
countTestCases(self)
debug(self)
Run the test without collecting errors in a TestResult
defaultTestResult(self)
fail(self, msg=None)
Fail immediately, with the given message.
failIf(self, expr, msg=None)
Fail the test if the expression is true.
failIfEqual(self, first, second, msg=None)
Fail if the two objects are equal as determined by the '=='
operator.
failUnless(self, expr, msg=None)
Fail the test unless the expression is true.
failUnlessEqual(self, first, second, msg=None)
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. If a different type of exception is
thrown, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.
id(self)
run(self, result=None)
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.
 
The default implementation of this method returns the first line of
the specified test method's docstring.
tearDown(self)
Hook method for deconstructing the test fixture after testing it.

Data and non-method functions inherited from unittest.TestCase:
failureException = <class exceptions.AssertionError at 0x007618B0>
Assertion failed.
 
class SimpleParseRecursiveTests(SimpleParseGrammarTests)
      Test parsing of grammar elements with generated version of simpleparse grammar
 
  
Method resolution order:
SimpleParseRecursiveTests
SimpleParseGrammarTests
unittest.TestCase

Methods defined here:
doBasicTest(self, parserName, testValue, expected)

Data and non-method functions defined here:
__doc__ = 'Test parsing of grammar elements with generated version of simpleparse grammar'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'simpleparse.tests.test_grammarparser'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from SimpleParseGrammarTests:
testChar1(self)
testChar2(self)
testChar3(self)
testChar4(self)
testChar5(self)
testChar6(self)
testChar7(self)
testChar8(self)
testChar85(self)
testChar9(self)
testCharNoBrace1(self)
testCharRange1(self)
testComment1(self)
testComment2(self)
testCutToken2(self)
testCutToken3(self)
testCutToken4(self)
testDeclaration(self)
testDeclaration2(self)
testDeclaration3(self)
testDeclaration4(self)
testDeclaration5(self)
testDeclarationSet1(self)
testDeclarationSet2(self)
Just tries to parse and sees that everything was parsed, doesn't predict the result
testElementToken1(self)
testElementToken2(self)
testElementToken3(self)
testElementToken4(self)
testElementToken5(self)
testElementToken6(self)
Lookahead indicator with positive
testElementToken7(self)
Lookahead indicator with negative
testElementToken8(self)
Error on fail indicator
testElementToken9(self)
Error on fail indicator with message
testErrorOnFailFlag1(self)
testExpandedName1(self)
testExpandedName2(self)
testFOGroup1(self)
testGroup1(self)
testGroup2(self)
testGroup3(self)
Test group with sequential added group
Note that this test also serves to test
the function of non-reporting names
testGroup4(self)
Test group with sequential added group
Note that this test also serves to test
the function of non-reporting names
testGroup5(self)
Test group with sequential added group
Note that this test also serves to test
the function of non-reporting names
testGroup6(self)
Test group with multiple / 'd values
testLiteral1(self)
testLiteral2(self)
testLiteral3(self)
testLiteral4(self)
testLiteral5(self)
testLiteral6(self)
testLiteralDecorator(self)
testLiteralDecorator2(self)
testLiteralDecorator3(self)
Decorator must be right next to literal, no whitespace
testLookAheadIndicator1(self)
testLookAheadIndicator2(self)
testName1(self)
testName2(self)
testName3(self)
testNegposIndicator1(self)
testNegposIndicator2(self)
testOccurenceIndicator1(self)
testOccurenceIndicator2(self)
testOccurenceIndicator3(self)
testOccurenceIndicator4(self)
testOccurenceIndicator5(self)
testRange1(self)
testRange2(self)
testRange3(self)
testRange4(self)
Test optional repeating children running into eof
 
Original SimpleParse had a major failure here,
system hung trying to parse the [] string.  Basically,
there was no check for EOF during a repeating-item
parse (save for literals and character sets), so you
wound up with infinite loops.
testRange5(self)
Test optional repeating children with no termination
 
Original SimpleParse had a major failure here,
system hung trying to parse the [] string.  Basically,
there was no check for EOF during a repeating-item
parse (save for literals and character sets), so you
wound up with infinite loops.
testSEQGroup1(self)
testSEQToken1(self)
testSeqGroup2(self)
testUnreportedName1(self)
testUnreportedName2(self)
testWhitespace1(self)
testWhitespace2(self)
testWhitespace3(self)
testWhitespace4(self)
testWhitespace5(self)
Bug in 2.0.0 where Null comments such as:
                "#
"
 
                didn't parse.

Methods inherited from unittest.TestCase:
_TestCase__exc_info = __exc_info(self)
Return a version of sys.exc_info() with the traceback frame
minimised; usually the top level of the traceback frame is not
needed.
__call__(self, result=None)
__init__(self, methodName='runTest')
Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
__repr__(self)
__str__(self)
assertEqual = failUnlessEqual(self, first, second, msg=None)
Fail if the two objects are unequal as determined by the '!='
operator.
assertEquals = failUnlessEqual(self, first, second, msg=None)
Fail if the two objects are unequal as determined by the '!='
operator.
assertNotEqual = failIfEqual(self, first, second, msg=None)
Fail if the two objects are equal as determined by the '=='
operator.
assertNotEquals = failIfEqual(self, first, second, msg=None)
Fail if the two objects are equal as determined by the '=='
operator.
assertRaises = 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. If a different type of exception is
thrown, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.
assert_ = failUnless(self, expr, msg=None)
Fail the test unless the expression is true.
countTestCases(self)
debug(self)
Run the test without collecting errors in a TestResult
defaultTestResult(self)
fail(self, msg=None)
Fail immediately, with the given message.
failIf(self, expr, msg=None)
Fail the test if the expression is true.
failIfEqual(self, first, second, msg=None)
Fail if the two objects are equal as determined by the '=='
operator.
failUnless(self, expr, msg=None)
Fail the test unless the expression is true.
failUnlessEqual(self, first, second, msg=None)
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. If a different type of exception is
thrown, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.
id(self)
run(self, result=None)
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.
 
The default implementation of this method returns the first line of
the specified test method's docstring.
tearDown(self)
Hook method for deconstructing the test fixture after testing it.

Data and non-method functions inherited from unittest.TestCase:
failureException = <class exceptions.AssertionError at 0x007618B0>
Assertion failed.
 
Functions
            
getSuite()
 
Data
             AnyInt = <Any Integer>
NullResult = <Null Children>
SPGenerator = <simpleparse.generator.Generator instance at 0x00AE5BE0>
__file__ = r'S:\sp\simpleparse\tests\test_grammarparser.pyc'
__name__ = 'simpleparse.tests.test_grammarparser'
declaration = 'declarationset := declaration+\ndeclaration...,[0-9a-fA-F],[0-9a-fA-F],[0-9a-fA-F],[0-9a-fA-F]\n'
recursiveParser = <simpleparse.parser.Parser instance at 0x009066E8>