From f28f904fceb827bd48d18017ddcec0529daef489 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 2 Nov 2003 08:44:17 +0000 Subject: [PATCH] more unit test work git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1952 57a73879-2fb5-44c3-a270-3262357dd7e2 --- test/db_test_base.py | 25 ++++++++++++++++++++++++- test/test_mysql.py | 5 +++-- test/test_sqlite.py | 6 ++++-- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/test/db_test_base.py b/test/db_test_base.py index 80285b1..3b6d357 100644 --- a/test/db_test_base.py +++ b/test/db_test_base.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: db_test_base.py,v 1.1 2003-10-25 22:53:26 richard Exp $ +# $Id: db_test_base.py,v 1.2 2003-11-02 08:44:17 richard Exp $ import unittest, os, shutil, errno, imp, sys, time @@ -817,6 +817,10 @@ class SchemaTest(MyTestCase): self.assertEqual(self.db.b.get(bid, 'name'), 'bear') self.assertEqual(self.db.b.lookup('bear'), bid) + # confirm journal's ok + self.db.getjournal('a', aid) + self.db.getjournal('b', bid) + def init_amod(self): self.db = self.module.Database(config, 'admin') a = self.module.Class(self.db, "a", name=String(), fooz=String()) @@ -849,6 +853,10 @@ class SchemaTest(MyTestCase): self.assertEqual(self.db.a.get(aid2, 'name'), 'aardvark') self.assertEqual(self.db.a.get(aid2, 'fooz'), 'booz') + # confirm journal's ok + self.db.getjournal('a', aid) + self.db.getjournal('a', aid2) + def init_amodkey(self): self.db = self.module.Database(config, 'admin') a = self.module.Class(self.db, "a", name=String(), fooz=String()) @@ -875,6 +883,9 @@ class SchemaTest(MyTestCase): self.init_amodkey() self.assertEqual(self.db.a.lookup('booz'), aid2) + # confirm journal's ok + self.db.getjournal('a', aid) + def init_ml(self): self.db = self.module.Database(config, 'admin') a = self.module.Class(self.db, "a", name=String()) @@ -903,6 +914,10 @@ class SchemaTest(MyTestCase): self.assertEqual(self.db.a.lookup('apple'), aid) self.assertEqual(self.db.b.lookup('bear'), bid) + # confirm journal's ok + self.db.getjournal('a', aid) + self.db.getjournal('b', bid) + def test_removeMultilink(self): # add a multilink prop self.init_ml() @@ -918,6 +933,10 @@ class SchemaTest(MyTestCase): self.assertEqual(self.db.a.lookup('apple'), aid) self.assertEqual(self.db.b.lookup('bear'), bid) + # confirm journal's ok + self.db.getjournal('a', aid) + self.db.getjournal('b', bid) + def test_removeClass(self): self.init_ml() aid = self.db.a.create(name='apple') @@ -935,6 +954,10 @@ class SchemaTest(MyTestCase): self.assertEqual(self.db.a.get(aid, 'name'), 'apple') self.assertEqual(self.db.a.lookup('apple'), aid) + # confirm journal's ok + self.db.getjournal('a', aid) + self.db.getjournal('b', bid) + class ClassicInitTest(unittest.TestCase): count = 0 diff --git a/test/test_mysql.py b/test/test_mysql.py index 2e16e5d..5825ff3 100644 --- a/test/test_mysql.py +++ b/test/test_mysql.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_mysql.py,v 1.2 2003-10-26 14:13:04 jlgijsbers Exp $ +# $Id: test_mysql.py,v 1.3 2003-11-02 08:44:17 richard Exp $ import unittest, os, shutil, time, imp @@ -86,7 +86,8 @@ MYSQL_DATABASE = (MYSQL_DBHOST, MYSQL_DBUSER, MYSQL_DBPASSWORD, MYSQL_DBNAME) l = db.issue.list() ae(l, []) - from roundup.backends import mysql as module + if hasattr(backends, 'mysql'): + from roundup.backends import mysql as module def tearDown(self): ClassicInitTest.tearDown(self) self.module.db_nuke(config) diff --git a/test/test_sqlite.py b/test/test_sqlite.py index 8479ef4..bf0cc22 100644 --- a/test/test_sqlite.py +++ b/test/test_sqlite.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_sqlite.py,v 1.1 2003-10-25 22:53:26 richard Exp $ +# $Id: test_sqlite.py,v 1.2 2003-11-02 08:44:17 richard Exp $ import unittest, os, shutil, time @@ -23,7 +23,9 @@ from db_test_base import DBTest, ROTest, SchemaTest, \ ClassicInitTest class sqliteOpener: - from roundup.backends import sqlite as module + from roundup import backends + if hasattr(backends, 'sqlite'): + from roundup.backends import sqlite as module class sqliteDBTest(sqliteOpener, DBTest): pass -- 2.30.2