[Modeling-cvs] ProjectModeling/Modeling/tests SQLite.cfg,NONE,1.1 test_EditingContext_Global.py,1.20
Status: Abandoned
Brought to you by:
sbigaret
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv24498/tests Modified Files: test_EditingContext_Global.py test_EditingContext_Global_Inheritance.py test_EditingContext_ParentChild.py Added Files: SQLite.cfg Log Message: Added a new adaptor layer for SQLite --- NEW FILE: SQLite.cfg --- # This file is used to initalize the model's connection dictionary and # adaptor's name when the tests are run for SQLite # Change this to reflect your own configuration [DEFAULT] adaptor: SQLite host: ignored user: ignored password: ignored [AuthorBooks] database: db_AuthorBooks.db [StoreEmployees] database: db_StoreEmployees.db Index: test_EditingContext_Global.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_EditingContext_Global.py 7 May 2003 11:27:10 -0000 1.20 --- test_EditingContext_Global.py 11 Jun 2003 11:10:18 -0000 1.21 *************** *** 114,117 **** --- 114,122 ---- self.failIf('fk_writer_id' in object.__dict__.keys()) self.failIf('_fk_writer_id' in object.__dict__.keys()) + + # check types + self.failIf(cleese.getAge()!=24) + from mx.DateTime import DateTime + self.failUnless(type(cleese.getBirthday())!=DateTime) #print objects #print objects[0].getE1() *************** *** 768,772 **** self.failIf(nb_objs!=3) # only 3: author 'Dard' is the only # one with a pygmalion ! def test_15_propagatesInsertionForRelatedObjects_01(self): "[EditingContext] propagatesInsertionForRelatedObjects (updated objects)" --- 773,777 ---- self.failIf(nb_objs!=3) # only 3: author 'Dard' is the only # one with a pygmalion ! def test_15_propagatesInsertionForRelatedObjects_01(self): "[EditingContext] propagatesInsertionForRelatedObjects (updated objects)" *************** *** 895,898 **** --- 900,907 ---- adaptorChannel.adaptorContext().beginTransaction() + if database_cfg=='SQLite.cfg': + sqlExpr2=adaptorChannel.adaptorContext().adaptor().expressionClass()() + sqlExpr2.setStatement('-- types int') + adaptorChannel.evaluateExpression(sqlExpr2) adaptorChannel.evaluateExpression(sqlExpr) row=adaptorChannel.fetchRow() *************** *** 901,905 **** self.failUnless(row.get('age', None)) ! self.failUnless(row['age']==508) adaptorChannel.cancelFetch() --- 910,914 ---- self.failUnless(row.get('age', None)) ! self.failUnless(int(row['age'])==508) adaptorChannel.cancelFetch() *************** *** 1001,1005 **** -h Prints this message -p enables profiling ! -d sets the database adaptor to use: Postgresql (default) or MySQL -r reinitialize the (postgresql) database the database defined in the model 'model_AuthorBooks' --- 1010,1014 ---- -h Prints this message -p enables profiling ! -d sets the database adaptor to use: Postgresql (default), MySQL or SQLite -r reinitialize the (postgresql) database the database defined in the model 'model_AuthorBooks' *************** *** 1032,1036 **** if k=='-p': profile=1; continue if k=='-d': ! if v not in ('Postgresql', 'MySQL'): usage(me, 1) database_cfg='%s.cfg'%v continue --- 1041,1045 ---- if k=='-p': profile=1; continue if k=='-d': ! if v not in ('Postgresql', 'MySQL', 'SQLite'): usage(me, 1) database_cfg='%s.cfg'%v continue Index: test_EditingContext_Global_Inheritance.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global_Inheritance.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_EditingContext_Global_Inheritance.py 7 May 2003 11:27:10 -0000 1.9 --- test_EditingContext_Global_Inheritance.py 11 Jun 2003 11:10:20 -0000 1.10 *************** *** 385,389 **** is altered: tables are dropped, then they are re-created along with constraints for PKs and FKs and PK support (sequences) ! -d sets the database adaptor to use: Postgresql (default) or MySQL """ % prgName if exitStatus is not None: --- 385,389 ---- is altered: tables are dropped, then they are re-created along with constraints for PKs and FKs and PK support (sequences) ! -d sets the database adaptor to use: Postgresql (default), MySQL or SQLite """ % prgName if exitStatus is not None: *************** *** 410,414 **** if k=='-p': profile=1; continue if k=='-d': ! if v not in ('Postgresql', 'MySQL'): usage(me, 1) database_cfg='%s.cfg'%v continue --- 410,414 ---- if k=='-p': profile=1; continue if k=='-d': ! if v not in ('Postgresql', 'MySQL', 'SQLite'): usage(me, 1) database_cfg='%s.cfg'%v continue Index: test_EditingContext_ParentChild.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_ParentChild.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_EditingContext_ParentChild.py 7 May 2003 11:27:10 -0000 1.7 --- test_EditingContext_ParentChild.py 11 Jun 2003 11:10:20 -0000 1.8 *************** *** 494,498 **** -h Prints this message -p enables profiling ! -d sets the database adaptor to use: Postgresql (default) or MySQL -r reinitialize the (postgresql) database the database defined in the model 'model_testBothSidesRels' --- 494,498 ---- -h Prints this message -p enables profiling ! -d sets the database adaptor to use: Postgresql (default),MySQL or SQLite -r reinitialize the (postgresql) database the database defined in the model 'model_testBothSidesRels' *************** *** 524,528 **** if k=='-p': profile=1; continue if k=='-d': ! if v not in ('Postgresql', 'MySQL'): usage(me, 1) database_cfg='%s.cfg'%v continue --- 524,528 ---- if k=='-p': profile=1; continue if k=='-d': ! if v not in ('Postgresql', 'MySQL', 'SQLite'): usage(me, 1) database_cfg='%s.cfg'%v continue |