From: <de...@us...> - 2003-04-05 00:28:01
|
Update of /cvsroot/pymerase/pymerase/tests In directory sc8-pr-cvs1:/tmp/cvs-serv16351 Modified Files: TestSchool.py Log Message: Take advantage of the new moduleReload function to force reloading our generated API. (Which is needed because this code generates two different APIs in the same python session). Index: TestSchool.py =================================================================== RCS file: /cvsroot/pymerase/pymerase/tests/TestSchool.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestSchool.py 3 Apr 2003 01:15:53 -0000 1.2 --- TestSchool.py 5 Apr 2003 00:27:58 -0000 1.3 *************** *** 2,8 **** from __future__ import nested_scopes import copy - import sys import os import string import unittest --- 2,9 ---- from __future__ import nested_scopes import copy import os + import re import string + import sys import unittest *************** *** 109,114 **** global givenNameFieldName givenNameFieldName="given_name" - global dataSourceName - dataSourceName = "data.sql" --- 110,113 ---- *************** *** 141,146 **** global givenNameFieldName givenNameFieldName='"GivenName"' - global dataSourceName - dataSourceName = "dataCapWord.sql" --- 140,143 ---- *************** *** 156,160 **** createDBText.append("\c school_d0") createDBText.append("\i school.sql") - #createDBText.append("\i %s" % (dataSourceName)) createdb.write(string.join(createDBText, os.linesep)) createdb.close() --- 153,156 ---- *************** *** 166,169 **** --- 162,166 ---- #os.remove(createDBName) + def testSimpleInsert(self): """Insert objects with all attributes manual initialized *************** *** 171,174 **** --- 168,172 ---- # also known as try to get rid of the using psql to load data import school + school.moduleReload() s = school.DBSession(host, database) *************** *** 269,272 **** --- 267,271 ---- def testReadOneToOneLink(self): import school + school.moduleReload() s = school.DBSession(host, database) *************** *** 285,288 **** --- 284,288 ---- def testReadManyToOneLink(self): import school + school.moduleReload() s = school.DBSession(host, database) *************** *** 301,305 **** --- 301,307 ---- def testOneToOneInsert(self): import school + school.moduleReload() s = school.DBSession(host, database) + houses = getHouses(s) faculty = getFaculty(s) *************** *** 354,358 **** --- 356,362 ---- def testManyToOneInsert(self): import school + school.moduleReload() s = school.DBSession(host, database) + charles = s.Students(6) daria = s.Students(7) *************** *** 377,381 **** def testTreeInsert(self): - import school def checkEmployee(session, givenName): --- 381,384 ---- *************** *** 384,388 **** --- 387,394 ---- return e[0] + import school + school.moduleReload() s = school.DBSession(host, database) + diane = checkEmployee(s, "diane") kevin = checkEmployee(s, "kevin") *************** *** 409,413 **** --- 415,421 ---- def testTreeRetrieval(self): import school + school.moduleReload() s = school.DBSession(host, database) + yolanda = getEmployee(s, "Yolanda")[0] managedList = yolanda.getManaged() |