* src/plugins/TestcaseGenerator.py: Added debbuging helpers for signal emissions

svn: r4614
This commit is contained in:
Martin Hawlisch 2005-05-18 13:36:07 +00:00
parent 64aac6f002
commit 9979fd1126
2 changed files with 105 additions and 0 deletions

View File

@ -3,6 +3,8 @@
src/RelLib.py: Catch invalid arguments instead of crashing.
TODO: raise TypeError or HandleError instead of simply returning?
* src/plugins/TestcaseGenerator.py: Added debbuging helpers for signal emissions
2005-05-17 Alex Roitman <shura@gramps-project.org>
* src/GenericFilter.py: Change filter rule names to make them consistent.
* src/gramps_main.py: Change filter names to make them consistent.

View File

@ -145,6 +145,109 @@ class TestcaseGenerator:
self.trans.set_batch(True)
self.db.disable_signals()
if self.multiple_transactions:
print "TESTING SIGNALS..."
print "\nCREATE PERSON"
p = RelLib.Person()
self.db.add_person( p, self.trans)
print "\nUPDATE PERSON"
self.db.commit_person( p, self.trans)
print "\nDELETE PERSON"
self.db.remove_person( p.get_handle(), self.trans)
print "\nCREATE FAMILY"
f = RelLib.Family()
self.db.add_family( f, self.trans)
print "\nUPDATE FAMILY"
self.db.commit_family( f, self.trans)
print "\nDELETE FAMILY"
self.db.remove_family( f.get_handle(), self.trans)
print "\nCREATE EVENT"
e = RelLib.Event()
self.db.add_event( e, self.trans)
print "\nUPDATE EVENT"
self.db.commit_event( e, self.trans)
print "\nDELETE EVENT"
self.db.remove_event( e.get_handle(), self.trans)
print "\nCREATE PLACE"
p = RelLib.Place()
self.db.add_place( p, self.trans)
print "\nUPDATE PLACE"
self.db.commit_place( p, self.trans)
print "\nDELETE PLACE"
self.db.remove_place( p.get_handle(), self.trans)
print "\nCREATE SOURCE"
s = RelLib.Source()
self.db.add_source( s, self.trans)
print "\nUPDATE SOURCE"
self.db.commit_source( s, self.trans)
print "\nDELETE SOURCE"
self.db.remove_source( s.get_handle(), self.trans)
print "\nCREATE MEDIA"
m = RelLib.MediaObject()
self.db.add_object( m, self.trans)
print "\nUPDATE MEDIA"
self.db.commit_media_object( m, self.trans)
print "\nDELETE MEDIA"
self.db.remove_object( m.get_handle(), self.trans)
print "DONE."
print "TESTING DB..."
print "\nCREATE PERSON None"
self.db.add_person( None, self.trans)
print "\nUPDATE PERSON None"
self.db.commit_person( None, self.trans)
print "\nDELETE PERSON Invalid Handle"
self.db.remove_person( "Invalid Handle", self.trans)
print "\nCREATE FAMILY None"
self.db.add_family( None, self.trans)
print "\nUPDATE FAMILY None"
self.db.commit_family( None, self.trans)
print "\nDELETE FAMILY Invalid Handle"
self.db.remove_family( "Invalid Handle", self.trans)
print "\nCREATE EVENT None"
self.db.add_event( None, self.trans)
print "\nUPDATE EVENT None"
self.db.commit_event( None, self.trans)
print "\nDELETE EVENT Invalid Handle"
self.db.remove_event( "Invalid Handle", self.trans)
print "\nCREATE PLACE None"
self.db.add_place( None, self.trans)
print "\nUPDATE PLACE None"
self.db.commit_place( None, self.trans)
print "\nDELETE PLACE Invalid Handle"
self.db.remove_place( "Invalid Handle", self.trans)
print "\nCREATE SOURCE None"
self.db.add_source( None, self.trans)
print "\nUPDATE SOURCE None"
self.db.commit_source( None, self.trans)
print "\nDELETE SOURCE Invalid Handle"
self.db.remove_source( "Invalid Handle", self.trans)
print "\nCREATE MEDIA None"
self.db.add_object( None, self.trans)
print "\nUPDATE MEDIA None"
self.db.commit_media_object( None, self.trans)
print "\nDELETE MEDIA Invalid Handle"
self.db.remove_object( "Invalid Handle", self.trans)
print "DONE."
if generate_bugs:
self.generate_broken_relations()