tests/test_lib_normaldate.py
author robin <robin@reportlab.com>
Tue, 07 Mar 2017 10:00:34 +0000
changeset 4330 617ffa6bbdc8
parent 4287 d73ddcc5dba5
permissions -rw-r--r--
changes for release 3.4.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4330
617ffa6bbdc8 changes for release 3.4.0
robin <robin@reportlab.com>
parents: 4287
diff changeset
     1
#Copyright ReportLab Europe Ltd. 2000-2017
4287
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
     2
#see license.txt for license details
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
     3
"""Tests for reportlab.lib.utils
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
     4
"""
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
     5
__version__='3.3.18'
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
     6
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, printLocation
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
     7
setOutDir(__name__)
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
     8
import os, time, sys, operator
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
     9
import reportlab
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    10
import unittest
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    11
from reportlab.lib import normalDate
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    12
ND=normalDate.NormalDate
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    13
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    14
class NormalDateTestCase(unittest.TestCase):
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    15
    def setUp(self):
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    16
        #the comparison data was obtained by running this in python27
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    17
        #from reportlab.lib import normalDate
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    18
        #import operator, sys
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    19
        #ND=normalDate.NormalDate
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    20
        #samples = (0,-2,2,3,None,ND(20160912),ND(20160911),ND(20160913))
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    21
        #OPN = 'lt le eq ne ge gt'.split()
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    22
        #
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    23
        #def v(x):
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    24
        #   return 'ND(%r)' % x if hasattr(x,'normalDate') else repr(x)
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    25
        #for opn in OPN:
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    26
        #   op = getattr(operator,opn)
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    27
        #   for left in samples:
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    28
        #       if opn not in ('ne','eq') and not hasattr(left,'normalDate'): continue
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    29
        #       for right in samples:
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    30
        #           sys.stdout.write('(%r,%s,%s,%s),\n' % (opn,v(left),v(right),repr(op(left,right))))
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    31
        self.comparisons = [
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    32
                ('lt',ND(20160912),0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    33
                ('lt',ND(20160912),-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    34
                ('lt',ND(20160912),2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    35
                ('lt',ND(20160912),3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    36
                ('lt',ND(20160912),None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    37
                ('lt',ND(20160912),ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    38
                ('lt',ND(20160912),ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    39
                ('lt',ND(20160912),ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    40
                ('lt',ND(20160911),0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    41
                ('lt',ND(20160911),-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    42
                ('lt',ND(20160911),2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    43
                ('lt',ND(20160911),3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    44
                ('lt',ND(20160911),None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    45
                ('lt',ND(20160911),ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    46
                ('lt',ND(20160911),ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    47
                ('lt',ND(20160911),ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    48
                ('lt',ND(20160913),0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    49
                ('lt',ND(20160913),-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    50
                ('lt',ND(20160913),2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    51
                ('lt',ND(20160913),3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    52
                ('lt',ND(20160913),None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    53
                ('lt',ND(20160913),ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    54
                ('lt',ND(20160913),ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    55
                ('lt',ND(20160913),ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    56
                ('le',ND(20160912),0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    57
                ('le',ND(20160912),-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    58
                ('le',ND(20160912),2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    59
                ('le',ND(20160912),3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    60
                ('le',ND(20160912),None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    61
                ('le',ND(20160912),ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    62
                ('le',ND(20160912),ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    63
                ('le',ND(20160912),ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    64
                ('le',ND(20160911),0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    65
                ('le',ND(20160911),-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    66
                ('le',ND(20160911),2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    67
                ('le',ND(20160911),3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    68
                ('le',ND(20160911),None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    69
                ('le',ND(20160911),ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    70
                ('le',ND(20160911),ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    71
                ('le',ND(20160911),ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    72
                ('le',ND(20160913),0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    73
                ('le',ND(20160913),-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    74
                ('le',ND(20160913),2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    75
                ('le',ND(20160913),3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    76
                ('le',ND(20160913),None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    77
                ('le',ND(20160913),ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    78
                ('le',ND(20160913),ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    79
                ('le',ND(20160913),ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    80
                ('eq',0,0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    81
                ('eq',0,-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    82
                ('eq',0,2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    83
                ('eq',0,3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    84
                ('eq',0,None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    85
                ('eq',0,ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    86
                ('eq',0,ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    87
                ('eq',0,ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    88
                ('eq',-2,0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    89
                ('eq',-2,-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    90
                ('eq',-2,2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    91
                ('eq',-2,3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    92
                ('eq',-2,None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    93
                ('eq',-2,ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    94
                ('eq',-2,ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    95
                ('eq',-2,ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    96
                ('eq',2,0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    97
                ('eq',2,-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    98
                ('eq',2,2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
    99
                ('eq',2,3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   100
                ('eq',2,None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   101
                ('eq',2,ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   102
                ('eq',2,ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   103
                ('eq',2,ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   104
                ('eq',3,0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   105
                ('eq',3,-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   106
                ('eq',3,2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   107
                ('eq',3,3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   108
                ('eq',3,None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   109
                ('eq',3,ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   110
                ('eq',3,ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   111
                ('eq',3,ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   112
                ('eq',None,0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   113
                ('eq',None,-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   114
                ('eq',None,2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   115
                ('eq',None,3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   116
                ('eq',None,None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   117
                ('eq',None,ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   118
                ('eq',None,ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   119
                ('eq',None,ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   120
                ('eq',ND(20160912),0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   121
                ('eq',ND(20160912),-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   122
                ('eq',ND(20160912),2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   123
                ('eq',ND(20160912),3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   124
                ('eq',ND(20160912),None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   125
                ('eq',ND(20160912),ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   126
                ('eq',ND(20160912),ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   127
                ('eq',ND(20160912),ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   128
                ('eq',ND(20160911),0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   129
                ('eq',ND(20160911),-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   130
                ('eq',ND(20160911),2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   131
                ('eq',ND(20160911),3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   132
                ('eq',ND(20160911),None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   133
                ('eq',ND(20160911),ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   134
                ('eq',ND(20160911),ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   135
                ('eq',ND(20160911),ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   136
                ('eq',ND(20160913),0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   137
                ('eq',ND(20160913),-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   138
                ('eq',ND(20160913),2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   139
                ('eq',ND(20160913),3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   140
                ('eq',ND(20160913),None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   141
                ('eq',ND(20160913),ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   142
                ('eq',ND(20160913),ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   143
                ('eq',ND(20160913),ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   144
                ('ne',0,0,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   145
                ('ne',0,-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   146
                ('ne',0,2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   147
                ('ne',0,3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   148
                ('ne',0,None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   149
                ('ne',0,ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   150
                ('ne',0,ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   151
                ('ne',0,ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   152
                ('ne',-2,0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   153
                ('ne',-2,-2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   154
                ('ne',-2,2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   155
                ('ne',-2,3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   156
                ('ne',-2,None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   157
                ('ne',-2,ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   158
                ('ne',-2,ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   159
                ('ne',-2,ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   160
                ('ne',2,0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   161
                ('ne',2,-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   162
                ('ne',2,2,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   163
                ('ne',2,3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   164
                ('ne',2,None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   165
                ('ne',2,ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   166
                ('ne',2,ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   167
                ('ne',2,ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   168
                ('ne',3,0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   169
                ('ne',3,-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   170
                ('ne',3,2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   171
                ('ne',3,3,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   172
                ('ne',3,None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   173
                ('ne',3,ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   174
                ('ne',3,ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   175
                ('ne',3,ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   176
                ('ne',None,0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   177
                ('ne',None,-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   178
                ('ne',None,2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   179
                ('ne',None,3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   180
                ('ne',None,None,False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   181
                ('ne',None,ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   182
                ('ne',None,ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   183
                ('ne',None,ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   184
                ('ne',ND(20160912),0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   185
                ('ne',ND(20160912),-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   186
                ('ne',ND(20160912),2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   187
                ('ne',ND(20160912),3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   188
                ('ne',ND(20160912),None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   189
                ('ne',ND(20160912),ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   190
                ('ne',ND(20160912),ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   191
                ('ne',ND(20160912),ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   192
                ('ne',ND(20160911),0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   193
                ('ne',ND(20160911),-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   194
                ('ne',ND(20160911),2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   195
                ('ne',ND(20160911),3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   196
                ('ne',ND(20160911),None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   197
                ('ne',ND(20160911),ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   198
                ('ne',ND(20160911),ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   199
                ('ne',ND(20160911),ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   200
                ('ne',ND(20160913),0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   201
                ('ne',ND(20160913),-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   202
                ('ne',ND(20160913),2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   203
                ('ne',ND(20160913),3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   204
                ('ne',ND(20160913),None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   205
                ('ne',ND(20160913),ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   206
                ('ne',ND(20160913),ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   207
                ('ne',ND(20160913),ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   208
                ('ge',ND(20160912),0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   209
                ('ge',ND(20160912),-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   210
                ('ge',ND(20160912),2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   211
                ('ge',ND(20160912),3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   212
                ('ge',ND(20160912),None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   213
                ('ge',ND(20160912),ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   214
                ('ge',ND(20160912),ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   215
                ('ge',ND(20160912),ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   216
                ('ge',ND(20160911),0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   217
                ('ge',ND(20160911),-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   218
                ('ge',ND(20160911),2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   219
                ('ge',ND(20160911),3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   220
                ('ge',ND(20160911),None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   221
                ('ge',ND(20160911),ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   222
                ('ge',ND(20160911),ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   223
                ('ge',ND(20160911),ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   224
                ('ge',ND(20160913),0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   225
                ('ge',ND(20160913),-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   226
                ('ge',ND(20160913),2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   227
                ('ge',ND(20160913),3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   228
                ('ge',ND(20160913),None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   229
                ('ge',ND(20160913),ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   230
                ('ge',ND(20160913),ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   231
                ('ge',ND(20160913),ND(20160913),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   232
                ('gt',ND(20160912),0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   233
                ('gt',ND(20160912),-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   234
                ('gt',ND(20160912),2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   235
                ('gt',ND(20160912),3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   236
                ('gt',ND(20160912),None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   237
                ('gt',ND(20160912),ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   238
                ('gt',ND(20160912),ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   239
                ('gt',ND(20160912),ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   240
                ('gt',ND(20160911),0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   241
                ('gt',ND(20160911),-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   242
                ('gt',ND(20160911),2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   243
                ('gt',ND(20160911),3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   244
                ('gt',ND(20160911),None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   245
                ('gt',ND(20160911),ND(20160912),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   246
                ('gt',ND(20160911),ND(20160911),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   247
                ('gt',ND(20160911),ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   248
                ('gt',ND(20160913),0,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   249
                ('gt',ND(20160913),-2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   250
                ('gt',ND(20160913),2,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   251
                ('gt',ND(20160913),3,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   252
                ('gt',ND(20160913),None,True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   253
                ('gt',ND(20160913),ND(20160912),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   254
                ('gt',ND(20160913),ND(20160911),True),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   255
                ('gt',ND(20160913),ND(20160913),False),
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   256
                ]
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   257
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   258
    def test1(self):
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   259
        '''test that normalDate comparisions work in the old python 2.x way'''
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   260
        for opn,left,right,gresult in self.comparisons:
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   261
            result = getattr(operator,opn)(left,right)
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   262
            self.assertEqual(gresult,result,"comparison test %s %s %s failed, expected %s got %s" % (left, opn, right, gresult, result))
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   263
 
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   264
def makeSuite():
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   265
    return makeSuiteForClasses(NormalDateTestCase)
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   266
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   267
if __name__ == "__main__": #noruntests
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   268
    unittest.TextTestRunner().run(makeSuite())
d73ddcc5dba5 fix NormalDate comprisons in python3.x; version-->3.3.18
robin
parents:
diff changeset
   269
    printLocation()