Projects
/
mdb-ng
Archived
4
0
Fork 0
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
mdb-ng/test/db_test.py

49 lines
1.1 KiB
Python
Raw Normal View History

#
# $Id$
#
import common, unittest
from unittest import TestCase
class mdbTest(TestCase):
def setUp(self):
import mdb
self.mdb = mdb
class connectTest(mdbTest):
def test_0(self):
db = self.mdb.connect("inputs/db-0/")
self.failUnless(db.__class__ == self.mdb.db.PVVDB)
class disconnectTest(mdbTest):
def test_0(self):
db = self.mdb.connect("inputs/db-0/")
self.mdb.disconnect(db)
class formatTest(mdbTest):
def test_0(self):
db = self.mdb.connect("inputs/db-0/")
format = db._PVVDB__format("inputs/format-legal-00")
self.failUnless(format['username'] == 'scalar' and
format['realname'] == 'scalar' and
format['uid'] == 'scalar' and
format['disk'] == 'list' and
format['bdb-uid'] == 'scalar' and
format['bdb-username'] == 'scalar' and
format['purged'] == 'scalar' and
format['membership'] == 'list')
#
# Run the library tests.
#
if __name__ == '__main__':
unittest.main()