Package parsedatetime :: Package tests
[hide private]
[frames] | no frames]

Package tests

source code

Unit tests for parsedatetime

The tests can be run as a suite by running:

   python run_tests.py parsedatetime

Requires Python 3.0 or later


Version: 1.0.0

Author: Mike Taylor (bear@code-bear.com)

Copyright: Copyright (c) 2004 Mike Taylor

License: Apache v2.0

Submodules [hide private]

Functions [hide private]
 
assertEqualWithComparator(comparator)
Fail a little less cryptically that unittest.assertTrue when comparing a result against a target value.
source code
 
compareResultByTimeTuplesAndFlags(result, check, dateOnly=False)
Ensures that flags are an exact match and time tuples a close match when given data in the format ((timetuple), flag)
source code
 
compareResultByFlags(result, check, dateOnly=False)
Ensures that flags are an exact match when given data in the format ((timetuple), flag)
source code
 
compareResultByTimeTupleRangesAndFlags(result, check, dateOnly=False)
Ensures that flags are an exact match and time tuples a close match when given data in the format ((timetuple), (timetuple), flag)
source code
 
_compareTimeTuples(target, value, dateOnly=False)
Ignores minutes and seconds as running the test could cross a minute boundary.
source code
 
_compareFlags(result, check) source code
Variables [hide private]
  __contributors__ = ['Darshana Chhajed', 'Michael Lim (lim.ck.m...
  log = logging.getLogger('parsedatetime')
  echoHandler = logging.StreamHandler()
  echoFormatter = logging.Formatter('%(levelname)-8s %(message)s')
  __package__ = 'parsedatetime.tests'
Function Details [hide private]

assertEqualWithComparator(comparator)

source code 

Fail a little less cryptically that unittest.assertTrue when comparing a result against a target value. Shows the result and the target in the failure message.

_compareTimeTuples(target, value, dateOnly=False)

source code 

Ignores minutes and seconds as running the test could cross a minute boundary. Technically the year, month, day, hour, minute, and second could all change if the test is run on New Year's Eve, but we won't worry about less than per-hour granularity.


Variables Details [hide private]

__contributors__

Value:
['Darshana Chhajed',
 'Michael Lim (lim.ck.michael@gmail.com)',
 'Bernd Zeimetz (bzed@debian.org)']