From 9979fd11261167c1732f223925ac74cdd227fb83 Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Wed, 18 May 2005 13:36:07 +0000 Subject: [PATCH] * src/plugins/TestcaseGenerator.py: Added debbuging helpers for signal emissions svn: r4614 --- gramps2/ChangeLog | 2 + gramps2/src/plugins/TestcaseGenerator.py | 103 +++++++++++++++++++++++ 2 files changed, 105 insertions(+) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 9bf135ccb..67d948fd6 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -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 * src/GenericFilter.py: Change filter rule names to make them consistent. * src/gramps_main.py: Change filter names to make them consistent. diff --git a/gramps2/src/plugins/TestcaseGenerator.py b/gramps2/src/plugins/TestcaseGenerator.py index 1223c4b42..7d81f2ac4 100644 --- a/gramps2/src/plugins/TestcaseGenerator.py +++ b/gramps2/src/plugins/TestcaseGenerator.py @@ -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()