basicproperty.tests.test_date
index
p:\properties\basicproperty\tests\test_date.py

 
Modules
       
basicproperty.common
basictypes.date_types
time
unittest

 
Classes
       
TestCase(object)
DTPropertyTest
object
TestClass

 
class DTPropertyTest(TestCase)
    
Method resolution order:
DTPropertyTest
TestCase
object

Methods defined here:
testCoerce(self)
Test the whole DATATABLE set for coercion

Methods inherited from TestCase:
__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)
assertAlmostEqual = failUnlessAlmostEqual(self, first, second, places=7, msg=None)
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.
 
Note that decimal places (from zero) is usually not the same
as significant digits (measured from the most signficant digit).
assertAlmostEquals = failUnlessAlmostEqual(self, first, second, places=7, msg=None)
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.
 
Note that decimal places (from zero) is usually not the same
as significant digits (measured from the most signficant digit).
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.
assertNotAlmostEqual = failIfAlmostEqual(self, first, second, places=7, msg=None)
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.
 
Note that decimal places (from zero) is usually not the same
as significant digits (measured from the most signficant digit).
assertNotAlmostEquals = failIfAlmostEqual(self, first, second, places=7, msg=None)
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.
 
Note that decimal places (from zero) is usually not the same
as significant digits (measured from the most signficant digit).
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.
failIfAlmostEqual(self, first, second, places=7, msg=None)
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.
 
Note that decimal places (from zero) is usually not the same
as significant digits (measured from the most signficant digit).
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.
failUnlessAlmostEqual(self, first, second, places=7, msg=None)
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.
 
Note that decimal places (from zero) is usually not the same
as significant digits (measured from the most signficant digit).
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 other attributes inherited from TestCase:
__dict__ = <dictproxy object at 0x01B1BDD0>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'TestCase' objects>
list of weak references to the object (if defined)
failureException = <class exceptions.AssertionError at 0x00764B10>
Assertion failed.

 
class TestClass(object)
     Data and other attributes defined here:
__dict__ = <dictproxy object at 0x01B1B990>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'TestClass' objects>
list of weak references to the object (if defined)
dt = <DateTimeProperty 'dt'>
documentation
dtd = <DateTimeDeltaProperty 'dtd'>
documentation
tod = <TimeOfDayProperty 'tod'>
documentation

 
Data
        DATATABLE = [('tod', [(<RelativeDateTime instance for 'YYYY-MM-DD 02:03:00' at 0x199ca80>, [<RelativeDateTime instance for 'YYYY-MM-DD 02:03:00' at 0x199cad0>, <RelativeDateTime instance for 'YYYY-(+03)-(+30) 02:03:00' at 0x199ca58>, u'2:3:.5', u'02:03:0.5', u'2:3:.5am', (2, 3, 0, 500), [2, 3, 0, 500]]), (<RelativeDateTime instance for 'YYYY-MM-DD 14:00:00' at 0x199cc10>, [<RelativeDateTime instance for 'YYYY-MM-DD 14:00:00' at 0x199c9b8>, <RelativeDateTime instance for 'YYYY-(+03)-(+30) 14:00:00' at 0x199cb98>, u'14', u'14:0:0', u'14:00', u'14:00pm', u'2pm', u'2 PM', '14', (14, 0, 0), (14,), (14, 0, 0, 0), 14, 14L, 14.0]), (<RelativeDateTime instance for 'YYYY-MM-DD 14:30:00' at 0x199cbc0>, [14.5]), (<RelativeDateTime instance for 'YYYY-MM-DD 00:30:00' at 0x199c800>, ['24:30', '48:30']), (<RelativeDateTime instance for 'YYYY-MM-DD 00:00:00' at 0x199ca30>, ['24:00', '12am', '0am']), (<RelativeDateTime instance for 'YYYY-MM-DD 12:00:00' at 0x1917c88>, ['0pm', '12pm'])], [('a', <class exceptions.ValueError at 0x00764D80>), (None, <class exceptions.TypeError at 0x00764540>), ('am', <class exceptions.ValueError at 0x00764D80>)]), ('dt', [(<mx.DateTime.DateTime object for '2003-02-23 00:00:00.00' at 1311de0>, [<mx.DateTime.DateTime object for '2003-02-23 00:00:00.00' at 1a1f0a0>, '2003-02-23', u'2003-02-23', (2003, 2, 23, 0, 0, 0, 6, 54, 0), 1045976400.0]), (<mx.DateTime.DateTime object for '2004-02-23 00:00:00.00' at 1a28260>, ['Feb 23rd', 'February 23', '02/23', 'feb 23']), (<mx.DateTime.DateTime object for '2003-02-23 00:00:00.00' at 1a282a0>, ['Feb 23, 2003', 'February 23, 2003', 'Sunday February 23, 2003', '2003-02-23', 'feb 23, 2003', '2003-02-23'])], []), ('dtd', [(<mx.DateTime.DateTimeDelta object for '1:02:03:04.00' at 1982598>, [<mx.DateTime.DateTimeDelta object for '1:02:03:04.00' at 19825e8>, '1 day, 2 hours, 3 minutes and 4 seconds', u'1 day, 2 hours, 3 minutes and 4 seconds', '1d2h3m4s']), (<mx.DateTime.DateTimeDelta object for '-02:03:04.00' at 19821b0>, ['-2:3:4.0', u'-2:3:4.0', '-2:3:4', (0, -2, -3, -4.0)]), (<mx.DateTime.DateTimeDelta object for '02:03:04.00' at 1982610>, ['2:3:4.0', u'2:3:4.0', '2:3:4', (0, 2, 3, 4.0)]), (<mx.DateTime.DateTimeDelta object for '02:03:04.34' at 18f6f98>, ['2:3:4.34', u'2:3:4.34', '2:3:4.34', (0, 2, 3, 4.3399999999999999)])], [])]
suite = <unittest.TestSuite tests=[<unittest.TestSuite t...st_date.DTPropertyTest testMethod=testCoerce>]>]>
t1 = 1045976400.0