summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 05786c3)
raw | patch | inline | side by side (parent: 05786c3)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 10 Sep 2002 01:27:13 +0000 (01:27 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 10 Sep 2002 01:27:13 +0000 (01:27 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1115 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/date.py | patch | blob | history | |
test/test_init.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/roundup/date.py b/roundup/date.py
index 8e20c49ac0a54b911291256690e3179a126f5463..484889bbeac2bda60d85075482811a18abeeedcb 100644 (file)
--- a/roundup/date.py
+++ b/roundup/date.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: date.py,v 1.26 2002-09-10 00:18:20 richard Exp $
+# $Id: date.py,v 1.27 2002-09-10 01:27:13 richard Exp $
__doc__ = """
Date, time and time interval handling.
2. a date from this date to produce an interval.
"""
if isinstance(other, Interval):
- other = Interval(other.get_tuple(), sign=-other.sign)
+ other = Interval(other.get_tuple())
+ other.sign *= -1
return self.__add__(other)
assert isinstance(other, Date), 'May only subtract Dates or Intervals'
if type(spec) == type(''):
self.set(spec)
else:
- self.sign = sign
- self.year, self.month, self.day, self.hour, self.minute, \
- self.second = spec
+ if len(spec) == 7:
+ self.sign, self.year, self.month, self.day, self.hour, \
+ self.minute, self.second = spec
+ else:
+ # old, buggy spec form
+ self.sign = sign
+ self.year, self.month, self.day, self.hour, self.minute, \
+ self.second = spec
def __cmp__(self, other):
"""Compare this interval to another interval."""
diff --git a/test/test_init.py b/test/test_init.py
index 3cd5b2779e3c9dbd44f5ad521a7b0198daaf0d2a..eab0160b9df89e1ada65f04652314ecf853c84f3 100644 (file)
--- a/test/test_init.py
+++ b/test/test_init.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: test_init.py,v 1.16 2002-09-10 00:19:54 richard Exp $
+# $Id: test_init.py,v 1.17 2002-09-10 01:27:13 richard Exp $
import unittest, os, shutil, errno, imp, sys
l = db.issue.list()
ae(l, [])
-class ExtendedTestCase(MyTestCase):
- backend = 'anydbm'
- def testCreation(self):
- ae = self.assertEqual
-
- # create the instance
- init.install(self.dirname, 'extended', self.backend)
- init.initialise(self.dirname, 'sekrit')
-
- # check we can load the package
- instance = imp.load_package(self.dirname, self.dirname)
-
- # and open the database
- db = instance.open()
-
- # check the basics of the schema and initial data set
- l = db.priority.list()
- ae(l, ['1', '2', '3', '4'])
- l = db.status.list()
- ae(l, ['1', '2', '3', '4', '5', '6', '7', '8'])
- l = db.keyword.list()
- ae(l, [])
- l = db.user.list()
- ae(l, ['1', '2'])
- l = db.msg.list()
- ae(l, [])
- l = db.file.list()
- ae(l, [])
- l = db.issue.list()
- ae(l, [])
- l = db.support.list()
- ae(l, [])
- l = db.rate.list()
- ae(l, ['1', '2', '3'])
- l = db.source.list()
- ae(l, ['1', '2', '3', '4'])
- l = db.platform.list()
- ae(l, ['1', '2', '3'])
- l = db.timelog.list()
- ae(l, [])
-
class bsddbClassicTestCase(ClassicTestCase):
backend = 'bsddb'
-class bsddbExtendedTestCase(ExtendedTestCase):
- backend = 'bsddb'
class bsddb3ClassicTestCase(ClassicTestCase):
backend = 'bsddb3'
-class bsddb3ExtendedTestCase(ExtendedTestCase):
- backend = 'bsddb3'
class metakitClassicTestCase(ClassicTestCase):
backend = 'metakit'
-class metakitExtendedTestCase(ExtendedTestCase):
- backend = 'metakit'
def suite():
l = [
unittest.makeSuite(ClassicTestCase, 'test'),
- unittest.makeSuite(ExtendedTestCase, 'test')
]
try:
import bsddb
l.append(unittest.makeSuite(bsddbClassicTestCase, 'test'))
- l.append(unittest.makeSuite(bsddbExtendedTestCase, 'test'))
except:
print 'bsddb module not found, skipping bsddb DBTestCase'
try:
import bsddb3
l.append(unittest.makeSuite(bsddb3ClassicTestCase, 'test'))
- l.append(unittest.makeSuite(bsddb3ExtendedTestCase, 'test'))
except:
print 'bsddb3 module not found, skipping bsddb3 DBTestCase'
try:
import metakit
l.append(unittest.makeSuite(metakitClassicTestCase, 'test'))
- l.append(unittest.makeSuite(metakitExtendedTestCase, 'test'))
except:
print 'metakit module not found, skipping metakit DBTestCase'
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index 16e9ce7c79eb8a9f93bfeee303f910a5f1a13313..63fe8d840ca91946652c5c731fa41122ae5a7b2d 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test_mailgw.py,v 1.27 2002-09-10 00:19:54 richard Exp $
+# $Id: test_mailgw.py,v 1.28 2002-09-10 01:27:13 richard Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
_________________________________________________________________________
''')
-class ExtMailgwTestCase(MailgwTestCase):
- schema = 'extended'
-
def suite():
l = [unittest.makeSuite(MailgwTestCase),
- unittest.makeSuite(ExtMailgwTestCase, 'test')
]
return unittest.TestSuite(l)