Update of /cvsroot/webware/Webware/MiddleKit/Tests/MKDelete.mkmodel
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4943/MKDelete.mkmodel
Modified Files:
Settings1.config Settings2.config TestEmpty.py
Log Message:
Added a test that a deleted object is removed from list attributes in other
objects.
Use database pool in MKDelete test, otherwise I get "too many connections"
errors from MySQL, or, after increasing the connection limit to 300,
other errors like:
"Can't create a new thread (errno 11). If you are not out of available
memory, you can consult the manual for a possible OS-dependent bug"
Looks like some hard limit is being reached for number of threads,
stack space, etc.
Index: Settings1.config
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Tests/MKDelete.mkmodel/Settings1.config,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Settings1.config 24 Feb 2004 02:04:14 -0000 1.1
--- Settings1.config 9 Mar 2004 21:10:42 -0000 1.2
***************
*** 2,4 ****
--- 2,5 ----
'UseBigIntObjRefColumns': False,
# 'SQLLog': { 'File': 'stdout', },
+ 'SQLConnectionPoolSize': 10,
}
Index: Settings2.config
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Tests/MKDelete.mkmodel/Settings2.config,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Settings2.config 24 Feb 2004 02:04:14 -0000 1.1
--- Settings2.config 9 Mar 2004 21:10:42 -0000 1.2
***************
*** 1,3 ****
--- 1,4 ----
{
'UseBigIntObjRefColumns': True,
+ 'SQLConnectionPoolSize': 10,
}
Index: TestEmpty.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Tests/MKDelete.mkmodel/TestEmpty.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestEmpty.py 3 May 2002 14:26:29 -0000 1.2
--- TestEmpty.py 9 Mar 2004 21:10:42 -0000 1.3
***************
*** 27,30 ****
--- 27,34 ----
print '*** passed testSelfList'
+ testListUpdate(store, I.I, DELETE_OBJECT)
+
+ print '*** passed testListUpdate'
+
# These are possible values for expectedResult
DELETE_FOO = 1
***************
*** 73,76 ****
--- 77,96 ----
cleanupTest(store, klass)
+ def testListUpdate(store, klass, expectedResult):
+ """
+ Test creating an instance of a specified class, pointed to by the list attribute in
+ an instance of Foo, which itself points to an instance of Bar. Then try to delete the specified class,
+ and make sure that Foo's list attribute is updated automatically.
+ """
+ # Run the test, deleting the specified object and verifying the expected result
+ object, foo, bar = setupListTest(store, klass)
+ assert len(foo.listOfI()) == 1
+ try:
+ runTest(store, klass, object, expectedResult)
+ assert len(foo.listOfI()) == 0
+ finally:
+ cleanupTest(store, klass)
+
+
def setupTest(store, klass):
"""
***************
*** 96,103 ****
def setupListTest(store, klass):
- """
- Setup 3 objects: one of the specified klass, pointing to a Foo, pointing to a Bar.
- Returns tuple (object of specified klass, foo, bar).
- """
# Create a Foo and a Bar, with the Foo pointing to the Bar
bar = Bar()
--- 116,119 ----
|