summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f7d4a96)
raw | patch | inline | side by side (parent: f7d4a96)
author | gmcm <gmcm@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 20 Sep 2002 19:26:28 +0000 (19:26 +0000) | ||
committer | gmcm <gmcm@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 20 Sep 2002 19:26:28 +0000 (19:26 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1202 57a73879-2fb5-44c3-a270-3262357dd7e2
test/test_db.py | patch | blob | history |
diff --git a/test/test_db.py b/test/test_db.py
index c9ef86857295c54b5a5229a326e468f7b5b3b9d0..33bc69caee2492bd67798394328bb1cb8f4bccae 100644 (file)
--- a/test/test_db.py
+++ b/test/test_db.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: test_db.py,v 1.52 2002-09-20 05:08:00 richard Exp $
+# $Id: test_db.py,v 1.53 2002-09-20 19:26:28 gmcm Exp $
import unittest, os, shutil, time
# class get
#
# invalid node id
- ar(IndexError, self.db.issue.get, '1', 'title')
+ ar(IndexError, self.db.issue.get, '99', 'title')
# invalid property name
ar(KeyError, self.db.status.get, '2', 'foo')
# class set
#
# invalid node id
- ar(IndexError, self.db.issue.set, '1', title='foo')
+ ar(IndexError, self.db.issue.set, '99', title='foo')
# invalid property name
ar(KeyError, self.db.status.set, '1', foo='foo')
# string property
# key name clash
ar(ValueError, self.db.status.set, '2', name='unread')
# set up a valid issue for me to work on
- self.db.issue.create(title="spam", status='1')
+ id = self.db.issue.create(title="spam", status='1')
# invalid link index
- ar(IndexError, self.db.issue.set, '6', title='foo', status='bar')
+ ar(IndexError, self.db.issue.set, id, title='foo', status='bar')
# invalid link value
- ar(ValueError, self.db.issue.set, '6', title='foo', status=1)
+ ar(ValueError, self.db.issue.set, id, title='foo', status=1)
# invalid multilink type
- ar(TypeError, self.db.issue.set, '6', title='foo', status='1',
+ ar(TypeError, self.db.issue.set, id, title='foo', status='1',
nosy='hello')
# invalid multilink index type
- ar(ValueError, self.db.issue.set, '6', title='foo', status='1',
+ ar(ValueError, self.db.issue.set, id, title='foo', status='1',
nosy=[1])
# invalid multilink index
- ar(IndexError, self.db.issue.set, '6', title='foo', status='1',
+ ar(IndexError, self.db.issue.set, id, title='foo', status='1',
nosy=['10'])
# invalid number value
ar(TypeError, self.db.user.create, username='foo', age='a')
self.assertNotEqual(date_stamp, date_stamp2)
def testPack(self):
- self.db.issue.create(title="spam", status='1')
+ id = self.db.issue.create(title="spam", status='1')
self.db.commit()
- self.db.issue.set('1', status='2')
+ self.db.issue.set(id, status='2')
self.db.commit()
# sleep for at least a second, then get a date to pack at
time.sleep(1)
pack_before = date.Date('.')
+ time.sleep(1)
# one more entry
- self.db.issue.set('1', status='3')
+ self.db.issue.set(id, status='3')
self.db.commit()
# pack
self.db.pack(pack_before)
- journal = self.db.getjournal('issue', '1')
+ journal = self.db.getjournal('issue', id)
# we should have the create and last set entries now
self.assertEqual(2, len(journal))