svn: r7277
This commit is contained in:
Alex Roitman 2006-08-27 20:13:55 +00:00
parent 064457b122
commit 70e3c36ded

View File

@ -375,7 +375,7 @@ class TestcaseGenerator(Tool.Tool):
fam = RelLib.Family() fam = RelLib.Family()
fam.set_father_handle(person1_h) fam.set_father_handle(person1_h)
fam.set_mother_handle(person2_h) fam.set_mother_handle(person2_h)
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.FamilyRelType.MARRIED,''))
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
#person1 = self.db.get_person_from_handle(person1_h) #person1 = self.db.get_person_from_handle(person1_h)
#person1.add_family_handle(fam_h) #person1.add_family_handle(fam_h)
@ -391,7 +391,7 @@ class TestcaseGenerator(Tool.Tool):
fam = RelLib.Family() fam = RelLib.Family()
#fam.set_father_handle(person1_h) #fam.set_father_handle(person1_h)
fam.set_mother_handle(person2_h) fam.set_mother_handle(person2_h)
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.FamilyRelType.MARRIED,''))
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
person1 = self.db.get_person_from_handle(person1_h) person1 = self.db.get_person_from_handle(person1_h)
person1.add_family_handle(fam_h) person1.add_family_handle(fam_h)
@ -407,7 +407,7 @@ class TestcaseGenerator(Tool.Tool):
fam = RelLib.Family() fam = RelLib.Family()
fam.set_father_handle(person1_h) fam.set_father_handle(person1_h)
#fam.set_mother_handle(person2_h) #fam.set_mother_handle(person2_h)
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.FamilyRelType.MARRIED,''))
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
person1 = self.db.get_person_from_handle(person1_h) person1 = self.db.get_person_from_handle(person1_h)
person1.add_family_handle(fam_h) person1.add_family_handle(fam_h)
@ -423,7 +423,7 @@ class TestcaseGenerator(Tool.Tool):
fam = RelLib.Family() fam = RelLib.Family()
fam.set_father_handle(person1_h) fam.set_father_handle(person1_h)
fam.set_mother_handle(person2_h) fam.set_mother_handle(person2_h)
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.FamilyRelType.MARRIED,''))
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
person1 = self.db.get_person_from_handle(person1_h) person1 = self.db.get_person_from_handle(person1_h)
person1.add_family_handle(fam_h) person1.add_family_handle(fam_h)
@ -439,7 +439,7 @@ class TestcaseGenerator(Tool.Tool):
fam = RelLib.Family() fam = RelLib.Family()
fam.set_father_handle(person1_h) fam.set_father_handle(person1_h)
fam.set_mother_handle(person2_h) fam.set_mother_handle(person2_h)
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.FamilyRelType.MARRIED,''))
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
person1 = self.db.get_person_from_handle(person1_h) person1 = self.db.get_person_from_handle(person1_h)
person1.add_family_handle(fam_h) person1.add_family_handle(fam_h)
@ -455,7 +455,7 @@ class TestcaseGenerator(Tool.Tool):
fam = RelLib.Family() fam = RelLib.Family()
fam.set_father_handle("InvalidHandle1") fam.set_father_handle("InvalidHandle1")
fam.set_mother_handle(person2_h) fam.set_mother_handle(person2_h)
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.FamilyRelType.MARRIED,''))
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
#person1 = self.db.get_person_from_handle(person1_h) #person1 = self.db.get_person_from_handle(person1_h)
#person1.add_family_handle(fam_h) #person1.add_family_handle(fam_h)
@ -471,7 +471,7 @@ class TestcaseGenerator(Tool.Tool):
fam = RelLib.Family() fam = RelLib.Family()
fam.set_father_handle(person1_h) fam.set_father_handle(person1_h)
fam.set_mother_handle("InvalidHandle2") fam.set_mother_handle("InvalidHandle2")
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.FamilyRelType.MARRIED,''))
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
person1 = self.db.get_person_from_handle(person1_h) person1 = self.db.get_person_from_handle(person1_h)
person1.add_family_handle(fam_h) person1.add_family_handle(fam_h)
@ -489,8 +489,11 @@ class TestcaseGenerator(Tool.Tool):
fam = RelLib.Family() fam = RelLib.Family()
fam.set_father_handle(person1_h) fam.set_father_handle(person1_h)
fam.set_mother_handle(person2_h) fam.set_mother_handle(person2_h)
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.FamilyRelType.MARRIED,''))
fam.add_child_handle(child_h) child_ref = RelLib.ChildRef()
child_ref.set_reference_handle(child_h)
self.fill_object(child_ref)
fam.add_child_ref(child_ref)
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
person1 = self.db.get_person_from_handle(person1_h) person1 = self.db.get_person_from_handle(person1_h)
person1.add_family_handle(fam_h) person1.add_family_handle(fam_h)
@ -510,8 +513,12 @@ class TestcaseGenerator(Tool.Tool):
fam = RelLib.Family() fam = RelLib.Family()
fam.set_father_handle(person1_h) fam.set_father_handle(person1_h)
fam.set_mother_handle(person2_h) fam.set_mother_handle(person2_h)
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.FamilyRelType.MARRIED,''))
#fam.add_child_handle(child_h) #fam.add_child_handle(child_h)
child_ref = RelLib.ChildRef()
child_ref.set_reference_handle(child_h)
self.fill_object(child_ref)
fam.add_child_ref(child_ref)
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
person1 = self.db.get_person_from_handle(person1_h) person1 = self.db.get_person_from_handle(person1_h)
person1.add_family_handle(fam_h) person1.add_family_handle(fam_h)
@ -520,7 +527,7 @@ class TestcaseGenerator(Tool.Tool):
person2.add_family_handle(fam_h) person2.add_family_handle(fam_h)
self.db.commit_person(person2,self.trans) self.db.commit_person(person2,self.trans)
child = self.db.get_person_from_handle(child_h) child = self.db.get_person_from_handle(child_h)
child.add_parent_family_handle(fam_h,RelLib.ChildRefType(),RelLib.ChildRefType()) child.add_parent_family_handle(fam_h)
self.db.commit_person(child,self.trans) self.db.commit_person(child,self.trans)
self.commit_transaction() # COMMIT TRANSACTION STEP self.commit_transaction() # COMMIT TRANSACTION STEP
@ -554,6 +561,7 @@ class TestcaseGenerator(Tool.Tool):
# Creates a person with a birth event having an empty type # Creates a person with a birth event having an empty type
person_h = self.generate_person(None,"Broken14",None) person_h = self.generate_person(None,"Broken14",None)
event = RelLib.Event() event = RelLib.Event()
event.set_type('')
event.set_description("Test for Broken14") event.set_description("Test for Broken14")
event_h = self.db.add_event(event,self.trans) event_h = self.db.add_event(event,self.trans)
event_ref = RelLib.EventRef() event_ref = RelLib.EventRef()
@ -590,24 +598,28 @@ class TestcaseGenerator(Tool.Tool):
# Creates a person with a birth event pointing to nonexisting place # Creates a person with a birth event pointing to nonexisting place
person_h = self.generate_person(None,"Broken17",None) person_h = self.generate_person(None,"Broken17",None)
event = RelLib.Event() event = RelLib.Event()
event.set_name("Birth") event.set_type(RelLib.EventType.BIRTH)
event.set_place_handle("InvalidHandle7") event.set_place_handle("InvalidHandle7")
event.set_description("Test for Broken17") event.set_description("Test for Broken17")
event_h = self.db.add_event(event,self.trans) event_h = self.db.add_event(event,self.trans)
event_ref = RelLib.EventRef()
event_ref.set_reference_handle(event_h)
person = self.db.get_person_from_handle(person_h) person = self.db.get_person_from_handle(person_h)
person.set_birth_handle(event_h) person.set_birth_ref(event_ref)
self.db.commit_person(person,self.trans) self.db.commit_person(person,self.trans)
self.commit_transaction() # COMMIT TRANSACTION STEP self.commit_transaction() # COMMIT TRANSACTION STEP
# Creates a person with an event pointing to nonexisting place # Creates a person with an event pointing to nonexisting place
person_h = self.generate_person(None,"Broken18",None) person_h = self.generate_person(None,"Broken18",None)
event = RelLib.Event() event = RelLib.Event()
event.set_name("Birth") event.set_type(RelLib.EventType.BIRTH)
event.set_place_handle("InvalidHandle8") event.set_place_handle("InvalidHandle8")
event.set_description("Test for Broken18") event.set_description("Test for Broken18")
event_h = self.db.add_event(event,self.trans) event_h = self.db.add_event(event,self.trans)
event_ref = RelLib.EventRef()
event_ref.set_reference_handle(event_h)
person = self.db.get_person_from_handle(person_h) person = self.db.get_person_from_handle(person_h)
person.add_event_handle(event_h) person.add_event_ref(event_ref)
self.db.commit_person(person,self.trans) self.db.commit_person(person,self.trans)
self.commit_transaction() # COMMIT TRANSACTION STEP self.commit_transaction() # COMMIT TRANSACTION STEP