Python: module simpleparse.tests.test_common_numbers

simpleparse.tests.test_common_numbers | index s:\sp\simpleparse\tests\test_common_numbers.py

Modules
`` |  |
simpleparse.dispatchprocessor | simpleparse.common.numbers | string | unittest

Classes
`` |  | unittest.TestCase CommonTests
class CommonTests(unittest.TestCase)
`` |
| Methods defined here: testBasic(self) Data and non-method functions defined here: __doc__ = None __module__ = 'simpleparse.tests.test_common_numbers' `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.`

Functions
`` |  | getSuite()

Data
`` |  | __file__ = r'S:\sp\simpleparse\tests\test_common_numbers.pyc' __name__ = 'simpleparse.tests.test_common_numbers' _data = [('int_unsigned', <class simpleparse.common.numbers.IntInterpreter at 0x007EAF48>, [('0 ', 1, 0), ('1 ', 1, 1), ('23 ', 2, 23), ('0x ', 1, 0), ('0. ', 1, 0)], ['.0', 'a']), ('int', <class simpleparse.common.numbers.IntInterpreter at 0x007EAF48>, [('0 ', 1, 0), ('1 ', 1, 1), ('23 ', 2, 23), ('0x ', 1, 0), ('0. ', 1, 0), ('+0 ', 2, 0), ('+1 ', 2, 1), ('+23 ', 3, 23), ('+0x ', 2, 0), ('+0. ', 2, 0), ('-0 ', 2, 0), ('-1 ', 2, -1), ('-23 ', 3, -23), ('-0x ', 2, 0), ('-0. ', 2, 0)], ['.0', 'a', '+.0', '+a', '-.0', '-a']), ('hex', <class simpleparse.common.numbers.HexInterpreter at 0x008063B8>, [('0x0 ', 3, 0), ('0x1 ', 3, 1), ('0x23 ', 4, 35), ('0x0x ', 3, 0), ('0x0. ', 3, 0), ('+0x0 ', 4, 0), ('+0x1 ', 4, 1), ('+0x23 ', 5, 35), ('+0x0x ', 4, 0), ('+0x0. ', 4, 0), ('-0x0 ', 4, 0), ('-0x1 ', 4, -1), ('-0x23 ', 5, -35), ('-0x0x ', 4, 0), ('-0x0. ', 4, 0), ('0xa ', 3, 10), ('0xaaaaaaaaaaaaaaaaa ', 19, 196765270119568550570L), ('0xA ', 3, 10), ('0xAAAAAAAAAAAAAAAAA ', 19, 196765270119568550570L)], ['.0', 'a', '+.0', '+a', '-.0', '-a', '0x ', '0xg', '0x']), ('binary_number', <class simpleparse.common.numbers.BinaryInterpreter at 0x00806738>, [('0b0 ', 2, 0), ('1b0 ', 2, 1), ('10b0 ', 3, 2), ('10000000000b0 ', 12, 1024), ('0B0 ', 2, 0), ('1B0 ', 2, 1), ('10B0 ', 3, 2), ('10000000000B0 ', 12, 1024)], ['.0', 'a', '+.0', '+a', '-.0', '-a', '0x ', '0xg', '0x']), ('float', <class simpleparse.common.numbers.FloatInterpreter at 0x008065E8>, [('0. ', 2, 0), ('1. ', 2, 1), ('23. ', 3, 23), ('.0 ', 2, 0), ('.1 ', 2, 0.10000000000000001), ('.23 ', 3, 0.23000000000000001), ('0.0x ', 3, 0), ('1.1x ', 3, 1.1000000000000001), ('2000000.22222222x ', 16, 2000000.2222222199), ('1.1e20 ', 6, 1.1e+020), ('1.1e-20 ', 7, 1.1e-020), ('-1.1e20 ', 7, -1.1e+020)], ['0x.0', '23', '-23', '-43*2a', '+23', '-a']), ('float_floatexp', <class simpleparse.common.numbers.FloatFloatExpInterpreter at 0x008064D0>, [('0. ', 2, 0), ('1. ', 2, 1), ('23. ', 3, 23), ('.0 ', 2, 0), ('.1 ', 2, 0.10000000000000001), ('.23 ', 3, 0.23000000000000001), ('0.0x ', 3, 0), ('1.1x ', 3, 1.1000000000000001), ('2000000.22222222x ', 16, 2000000.2222222199), ('1.1e20 ', 6, 1.1000000000000002e+020), ('1.1e-20 ', 7, 1.1e-020), ('-1.1e20 ', 7, -1.1000000000000002e+020), ('1.1e20.34 ', 9, 2.4065377863445073e+020), ('1.1e-.34 ', 8, 0.50279700857636256)], ['0x.0', '23', '-23', '-43*2a', '+23', '-a'])]