def test_family(self):
        '''
        This test will check the basic operation of family classes
        '''
        father = gen_profile("Father", "Profile")
        mother = gen_profile("Mother", "Profile")
        child1 = gen_profile("Child", "First")
        child2 = gen_profile("Child", "Second")

        event1 = event_profile("birth")
        assert (event1.setDate(2013, month=2, accuracy="ABOUT"))

        family1 = family_profile(child=3)
        assert (len(family1.getChildren()) == 1)

        family2 = family_profile(child=[1, 2])
        assert (len(family2.getChildren()) == 2)

        family3 = family_profile(child=[1, 2],
                                 father=3,
                                 mother=4,
                                 marriage=event1)
        assert (family3.father and family3.mother and family3.children
                and family3.marriage)
        assert (family3.getFather() == 3)
        assert (family3.getMother() == 4)
Exemple #2
0
    def test_using_vocento_reader(self):
        '''
        Test checking all Vocento Parses parser
        '''
        profile = gen_profile("José Luis", "García Martín")
        profile.setCheckedDateWithDates("birth", date(1931, 4, 2), "EXACT")
        reader = vocento_reader()
        records = reader.profile_is_matched(profile)
        assert (len(records) > 0)

        profile2 = gen_profile("Carmen", "Martín")
        profile2.setCheckedDateWithDates("birth", date(1935, 4, 2), "EXACT")
        reader = vocento_reader(reader="ELCORREO")
        records = reader.profile_is_matched(profile2)
        assert (len(records) > 1)

        profile3 = gen_profile("José", "García Pérez")
        reader = vocento_reader(reader="ELDIARIOMONTAÑES")
        records = reader.profile_is_matched(profile3)
        assert (len(records) > 2)

        profile4 = gen_profile("María", "Martín")
        profile4.setCheckedDateWithDates("birth", date(1942, 4, 2), "EXACT")
        reader = vocento_reader(reader="IDEAL")
        records = reader.profile_is_matched(profile4)
        assert (len(records) > 6)

        profile5 = gen_profile("José", "Martínez García")
        profile5.setCheckedDateWithDates("birth", date(1933, 4, 2), "EXACT")
        reader = vocento_reader(reader="LARIOJA")
        records = reader.profile_is_matched(profile5)
        assert (len(records) > 1)
    def test_creating_a_child(self):
        '''
        Test creation of a child profile
        '''
        child_profile = gen_profile(ACTUAL_NAME, FATHER_SURNAME)
        child_profile.setCheckedGender("M")
        child_profile.set_name_2_show(ACTUAL_NAME)
        child_profile.setCheckedDate("birth_date", date(2017, 11, 20), "ABOUT")
        child_profile.setCheckedDate("death_date", date(2017, 12, 1), "EXACT")
        child_profile.add_nickname("my_nickname")
        profile.profile.create_as_a_child(child_profile,
                                          union=UNION_MAIN_PROFILE)

        data_id = child_profile.geni_specific_data['guid']
        assert (child_profile.properly_executed)
        assert (child_profile.existing_in_geni)
        #Check input of data
        assert (child_profile.data["gender"] == "male")
        assert (child_profile.data["last_name"] == FATHER_SURNAME)
        #Checking dates
        assert (child_profile.data["birth"]["date"]["year"] == 2017)
        assert (child_profile.data["birth"]["date"]["circa"] == True)
        self.assertFalse("month" in child_profile.data["birth"]["date"].keys())
        assert (child_profile.data["death"]["date"]["year"] == 2017)
        assert (child_profile.data["death"]["date"]["month"] == 12)
        assert (child_profile.data["death"]["date"]["day"] == 1)
        assert (child_profile.data["public"] == False)
        assert ("my_nickname" in child_profile.data["nicknames"])
        prof_relations = profile.profile(MAIN_SANDBOX_PROFILE, type_geni="")

        assert (len(prof_relations.marriage_union) == 1)
        for dif_union in prof_relations.marriage_union:
            assert ("union-156" in dif_union.union_id)
        for dif_union in prof_relations.parent_union:
            assert ("union-155" in dif_union.union_id)

        #We introduce other 2 childs using different methods
        second_profile = gen_profile(ACTUAL_SECOND, FATHER_SURNAME)
        profile.profile.create_as_a_child(second_profile,
                                          profile=prof_relations)
        third_profile = gen_profile(ACTUAL_THIRD, FATHER_SURNAME)
        profile.profile.create_as_a_child(third_profile,
                                          geni_input=MAIN_SANDBOX_PROFILE,
                                          type_geni="")
        assert (second_profile.properly_executed)
        assert (third_profile.properly_executed)

        #We delete to avoid creation of data
        assert (child_profile.delete_profile())
        assert (second_profile.delete_profile())
        assert (third_profile.delete_profile())
        self.assertFalse(child_profile.existing_in_geni)

        #We check is deleted
        existing = profile.profile(data_id)

        assert (existing.geni_specific_data['deleted'])
 def test_list_profile(self):
     '''
     Test converting a list of profiles into gedcom
     '''
     child1 = gen_profile("Francisco", "Vargas Sanz")
     child2 = gen_profile("Roberto", "Vargas Sanz")
     array = [child1, child2]
     gedcom_profile.convert_gedcom(array)
     for prof in array:
         assert (hasattr(prof, 'individual'))
    def test_merge_profile(self):
        '''
        Test merge of profiles
        '''
        profile = gen_profile("Juana", "Bargas")
        profile2 = gen_profile("Juana", "de Bargas Gómez")
        profile.setCheckedDate("birth", 2016, 4, 23, "EXACT")
        date1 = date(2016, 1, 1)
        date2 = date(2018, 8, 25)
        date3 = date(2018, 8, 27)
        profile2.setCheckedDateWithDates("birth", date1, accuracy="ABOUT")
        profile.setCheckedDate("death", 2018, 1, 1, "ABOUT")
        profile2.setCheckedDate("death", 2018, 8, 24, "EXACT")
        profile2.setCheckedDate("baptism", 2017, 1, 1, "ABOUT")
        profile2.setCheckedDateWithDates("burial",
                                         date2,
                                         accuracy="BETWEEN",
                                         date2=date3)
        profile.setComments("comment1")
        profile2.setComments("comment2")
        profile.setWebReference("THIS")
        profile2.setWebReference("OTHER")
        profile.gen_data["birth_place"] = {}
        profile.gen_data["birth_place"]["raw"] = "a"
        profile2.setPlaces("birth", GENERIC_PLACE_WITH_PLACE)

        result = profile.merge_profile(profile2,
                                       language="es",
                                       convention="spanish_surname")

        assert (result)
        assert (profile.gen_data["name"] == "Juana")
        assert (profile.gen_data["surname"] == "de Bargas Gómez")
        assert (profile.gen_data["birth"].get_date() == date(2016, 4, 23))
        assert (profile.gen_data["birth"].get_accuracy() == "EXACT")
        assert (profile.gen_data["comments"] == "comment1\ncomment2")
        assert ("THIS" in profile.get_all_urls())
        assert ("OTHER" in profile.get_all_urls())
        assert (len(profile.get_all_webs()) == 2)
        assert (profile2.gen_data["death"].get_date() == date(2018, 8, 24))
        assert (profile2.gen_data["death"].get_accuracy() == "EXACT")
        assert (profile2.gen_data["burial"].get_accuracy() == "BETWEEN")
        assert (profile2.gen_data["burial"].get_year_end() == 2018)
        assert (profile2.gen_data["baptism"].get_date() == date(2017, 1, 1))
        assert (profile2.gen_data["baptism"].get_accuracy() == "ABOUT")
        assert (
            profile2.gen_data["birth"].get_location()["city"] == "La Parrilla")

        profile3 = gen_profile("Juana", "Bargas")
        profile4 = gen_profile("Facundo", "Smith")
        result2 = profile3.merge_profile(profile4,
                                         language="es",
                                         convention="spanish_surname")
        self.assertFalse(result2)
Exemple #6
0
 def test_accuracy_in_dates(self):
     '''
     Testing the accuracy as introduced in dates
     '''
     profile = gen_profile("Name", "Surname")
     assert (profile.setCheckedDate("birth", 2016, 10, 20))
     assert (profile.setCheckedDate("residence", 2016, accuracy="ABOUT"))
     profile2 = gen_profile("Name", "Surname")
     assert (profile2.setCheckedDate("birth", 2016, 10, 20))
     assert (profile2.setCheckedDate("death", 2016, 12, 31))
     assert (profile2.setCheckedDate("residence", 2016, accuracy="ABOUT"))
Exemple #7
0
    def test_comparison_profile(self):
        '''
        Test some profile comparison 
        '''
        profile = gen_profile("Name", "Surname")
        profile2 = gen_profile("Name", "Surname")
        profile3 = gen_profile("Name", "Surname")

        profile.setCheckedGender("M")
        profile2.setCheckedGender("M")

        score, factor = profile.comparison_score(profile2)
        assert (score == 4.5)
        assert (factor == 1.0)

        profile2.setCheckedGender("F")
        score, factor = profile.comparison_score(profile2)
        assert (score == 4.0)
        assert (factor == 0.1)

        profile.setCheckedDate("birth", 2012, 1, 23)
        profile2.setCheckedDate("birth", 1980, accuracy="ABOUT")
        score, factor = profile.comparison_score(profile2)
        assert (score > 4)
        assert (factor < 0.005)

        profile3.setCheckedDate("birth", 1800)
        score, factor = profile.comparison_score(profile3)
        assert (score)
        assert (factor == 0.0)

        #Testing wrong matching

        profile4 = gen_profile("Name", "Surname")
        profile4.setCheckedDate("residence", 1700)
        profile4.setCheckedDate("death", 1760)

        profile5 = gen_profile("Name", "Surname")
        profile5.setCheckedDate("baptism", 1799)
        profile5.setCheckedDate("residence", 1800)
        profile5.setCheckedDate("residence", 1860)

        assert (profile4.get_earliest_event_in_event_form().get_year() == 1700)
        assert (profile4.get_latest_event_in_event_form().get_year() == 1760)
        assert (profile5.get_earliest_event_in_event_form().get_year() == 1799)
        assert (profile5.get_latest_event_in_event_form().get_year() == 1860)
        score, factor = profile4.comparison_score(profile5)
        assert (score * factor == 0.0)
Exemple #8
0
 def test_burial_date_earlier_than_death_date(self):
     '''
     Test burial date before death date is wrong
     '''
     profile = gen_profile("Name", "Surname")
     assert (profile.setCheckedDate("death", 2016, 10, 20))
     self.assertFalse(profile.setCheckedDate("burial", 2016, 10, 19))
Exemple #9
0
 def test_wrong_input(self):
     '''
     Test wrong input date class
     '''
     birth_date = date(2016, 10, 20)
     profile = gen_profile("Name", "Surname")
     assert (not profile.setCheckedDate("no_valid_date", birth_date))
Exemple #10
0
 def test_error_create_child(self):
     '''
     Test wrong inputs creating a child
     '''
     child_profile = gen_profile(ACTUAL_NAME, FATHER_SURNAME)
     child_profile.setCheckedGender("M")
     self.assertFalse(profile.profile.create_as_a_child(child_profile, geni_input = "https://sandbox.geni.com/people/Brother-Profile/1150205" ))
 def handle_data(self, data):
     if self.inname:
         self.inname = False
         name, surname, _ = get_name_surname_from_complete_name(
             data, convention="spanish_surname", language="es")
         profile = gen_profile(name, surname)
         self.records.append(profile)
Exemple #12
0
    def test_introducing_gender_living(self):
        '''
        Testing right introduction of gender and living in common_profile
        '''
        profile = gen_profile(ACTUAL_NAME, FATHER_SURNAME)
        assert (profile.setCheckedGender("F"))
        assert (profile.setCheckedGender("M"))
        assert (profile.setCheckedGender("U"))
        assert (profile.gen_data["name_to_show"] == ACTUAL_NAME + " " +
                FATHER_SURNAME)
        self.assertFalse(profile.setCheckedGender("J"))
        profile.setLiving(True)
        assert (profile.getLiving())

        #We test some None values and other outputs from common_profile
        profile2 = gen_profile(ACTUAL_NAME, FATHER_SURNAME)
        assert (profile2.get_earliest_event() is None)
Exemple #13
0
 def test_esquelas(self):
     '''
     Test checking el Esquelas parser
     '''
     profile = gen_profile("José Luis", "García Martín")
     reader = esquelas_reader()
     records = reader.profile_is_matched(profile)
     assert (len(records) > 1)
Exemple #14
0
 def test_wrong_input(self):
     '''
     Test wrong input date class
     '''
     birth_date = date(2016, 10, 20)
     profile = gen_profile("Name", "Surname")
     with self.assertRaises(NameError):
         profile.setCheckedDate("no_valid_date", birth_date)
Exemple #15
0
 def test_accuracy_in_dates(self):
     '''
     Testing the accuracy as introduced in dates
     '''
     profile = gen_profile("Name", "Surname")
     test_date = date(2016, 10, 20)
     residence_date = date(2016, 1, 1)
     death_date = date(2016, 12, 31)
     late_residence_date = date(2016, 1, 1)
     assert (profile.setCheckedDate("birth_date", test_date))
     assert (profile.setCheckedDate("residence_date", residence_date,
                                    "ABOUT"))
     profile2 = gen_profile("Name", "Surname")
     assert (profile2.setCheckedDate("birth_date", test_date))
     assert (profile2.setCheckedDate("death_date", death_date))
     assert (profile2.setCheckedDate("residence_date", late_residence_date,
                                     "ABOUT"))
Exemple #16
0
 def __init__(self,
              gedcomfile,
              language="en",
              name_convention="father_surname"):
     '''
     Introduce a gedcomfile in GEDCOM format
     '''
     self.gedcomfile = gedcomfile
     self.language = language
     self.name_convention = name_convention
     self.profiles = []
     for ele in self.gedcomfile.__dict__["root_elements"]:
         if (ele.tag == "INDI"):
             profile = gen_profile("", "")
             for sub_ele in ele.__dict__['child_elements']:
                 if sub_ele.tag == "NAME":
                     for name_ele in sub_ele.__dict__['child_elements']:
                         if (name_ele.tag == "GIVN"):
                             profile.set_name(name_ele.value)
                         if (name_ele.tag == "SURN"):
                             profile.set_surname(name_ele.value)
                 if sub_ele.tag == "BAPM":
                     for name_ele in sub_ele.__dict__['child_elements']:
                         if (name_ele.tag == "DATE"):
                             profile.setCheckedDate(
                                 "baptism_date",
                                 datetime.datetime.strptime(
                                     name_ele.value.replace(
                                         "BEF ",
                                         "").replace("AFT ", "").replace(
                                             "ABT ", ""),
                                     "%d %b %Y").date(),
                                 accuracy_data(name_ele.value))
                 if sub_ele.tag == "BIRT":
                     for name_ele in sub_ele.__dict__['child_elements']:
                         if (name_ele.tag == "DATE"):
                             profile.setCheckedDate(
                                 "birth_date",
                                 datetime.datetime.strptime(
                                     name_ele.value.replace(
                                         "BEF ",
                                         "").replace("AFT ", "").replace(
                                             "ABT ", ""),
                                     "%d %b %Y").date(),
                                 accuracy_data(name_ele.value))
                 if sub_ele.tag == "DEAT":
                     for name_ele in sub_ele.__dict__['child_elements']:
                         if (name_ele.tag == "DATE"):
                             profile.setCheckedDate(
                                 "death_date",
                                 datetime.datetime.strptime(
                                     name_ele.value.replace(
                                         "BEF ",
                                         "").replace("AFT ", "").replace(
                                             "ABT ", ""),
                                     "%d %b %Y").date(),
                                 accuracy_data(name_ele.value))
             self.profiles.append(profile)
 def test_using_abc_records(self):
     '''
     Test use of abc records
     '''
     profile = gen_profile("José", "García Reyes")
     profile.setCheckedDate("birth_date", date(1931,4,2), "EXACT")
     reader = abc_reader()
     records = reader.profile_is_matched(profile)
     assert(len(records) >0 )
Exemple #18
0
 def test_introducing_gender(self):
     '''
     Testing right introduction of gender in common_profile
     '''
     profile = gen_profile(ACTUAL_NAME, FATHER_SURNAME)
     assert(profile.setCheckedGender("F"))
     assert(profile.setCheckedGender("M"))
     assert(profile.gen_data["name_to_show"] == ACTUAL_NAME + " " + FATHER_SURNAME)
     self.assertFalse(profile.setCheckedGender("J"))
 def test_avoiding_analysis(self):
     '''
     Test confirming no analysis if antique record
     '''
     profile = gen_profile("Julián", "Gómez Gómez")
     profile.setCheckedDate("baptism", 1870, 4, 2, "EXACT")
     reader = rememori_reader()
     records = reader.profile_is_matched(profile)
     assert (len(records) == 0)
Exemple #20
0
 def handle_endtag(self, tag):
     if tag == "li" and self.inside_profile: self.inside_profile = False
     if self.counter == 3:
         profile = gen_profile(self.name.title().strip(), self.surname1.title().strip() + " " + self.surname2.title().strip())
         if self.web_ref: profile.setWebReference(self.web_ref)
         else: profile.setWebReference("Not available for : " + self.name+ " " + self.surname1 + " " + self.surname2)
         if self.death_date: profile.setCheckedDate("death", self.death_date.year, self.death_date.month, self.death_date.day, "EXACT")
         self.profiles.append(profile)
         self.initiate_person_data()
Exemple #21
0
 def test_valencia(self):
     '''
     Tests the database of valencia cementry
     '''
     profile = gen_profile("José", "García López")
     profile.setCheckedDate("death", 1993, accuracy="ABOUT")
     reader = valencia_reader()
     records = reader.profile_is_matched(profile)
     assert(len(records)>5)
Exemple #22
0
    def test_comparison_profile(self):
        '''
        Test some profile comparison 
        '''
        profile = gen_profile("Name", "Surname")
        profile2 = gen_profile("Name", "Surname")

        profile.setCheckedGender("M")
        profile2.setCheckedGender("M")

        score, factor = profile.comparison_score(profile2)
        assert (score == 4.5)
        assert (factor == 1.0)

        profile2.setCheckedGender("F")
        score, factor = profile.comparison_score(profile2)
        assert (score == 4.0)
        assert (factor == 0.5)
Exemple #23
0
 def test_other_functions(self):
     '''
     Testing of other functions in common profile
     '''
     profile = gen_profile("Name", "Surname")
     profile.returnFullName()
     profile.setComments("TEST COMMENT")
     profile.set_surname("TEST SURNAME")
     assert (profile.gen_data["name_to_show"] == profile.nameLifespan())
    def test_creating_gedcom_from_common(self):
        '''
        Test creating a GedCom from a common_profile
        '''
        profile = gen_profile("Juana", "Bargas")
        profile.setCheckedGender("F")
        profile.add_nickname("Nick1")
        profile.add_nickname("Nick2")
        profile.setCheckedDate("birth", 2014, 3, 2, accuracy="EXACT")
        profile.setCheckedDate("baptism", 2014, 3, 3, accuracy="AFTER")
        profile.setCheckedDate("death", 2016, 3, 2, accuracy="ABOUT")
        profile.setCheckedDate("burial", 2016, 3, 5, accuracy="BEFORE")
        profile.setPlaces("birth",
                          "Portillo,Valladolid,Castile and Leon,Spain",
                          language="es")
        #We transform to the gedcom class
        gedcom_profile.convert_gedcom(profile)

        gedcom_transform = profile.individual
        for ele in gedcom_transform.__dict__["child_elements"]:
            if ele.tag == "NAME":
                for sub_ele in ele.__dict__["child_elements"]:
                    if sub_ele.tag == "GIVN": assert (sub_ele.value == "Juana")
                    if sub_ele.tag == "SURN":
                        assert (sub_ele.value == "Bargas")
                    if sub_ele.tag == "NICK":
                        assert (sub_ele.value == "Nick1,Nick2")
            elif ele.tag == "SEX":
                assert (ele.value == "F")
            elif ele.tag == "BIRT":
                for sub_ele in ele.__dict__["child_elements"]:
                    if sub_ele.tag == "DATE":
                        assert (sub_ele.value == "02 MAR 2014")
                    if sub_ele.tag == "ADDR":
                        for sub_ele2 in sub_ele.__dict__["child_elements"]:
                            if sub_ele2.tag == "CITY":
                                assert (sub_ele2.value == "Portillo")
                            if sub_ele2.tag == "STAE":
                                assert (sub_ele2.value == "Castilla y León")
                            if sub_ele2.tag == "CTRY":
                                assert (sub_ele2.value == "España")
            elif ele.tag == "DEAT":
                for sub_ele in ele.__dict__["child_elements"]:
                    if sub_ele.tag == "DATE":
                        assert (sub_ele.value == "ABT 02 MAR 2016")
            elif ele.tag == "BAPM":
                for sub_ele in ele.__dict__["child_elements"]:
                    if sub_ele.tag == "DATE":
                        assert (sub_ele.value == "AFT 03 MAR 2014")
            elif ele.tag == "BURI":
                for sub_ele in ele.__dict__["child_elements"]:
                    if sub_ele.tag == "DATE":
                        assert (sub_ele.value == "BEF 05 MAR 2016")

        gedcomfile = gedcom.GedcomFile()
        gedcomfile.add_element(profile.individual)
Exemple #25
0
    def test_merge_profile(self):
        '''
        Test merge of profiles
        '''
        profile = gen_profile("Juana", "Bargas")
        profile2 = gen_profile("Juana", "de Bargas Gómez")
        profile.setCheckedDate("birth_date", date(2016, 4, 23), "EXACT")
        profile2.setCheckedDate("birth_date", date(2016, 1, 1), "ABOUT")
        profile.setCheckedDate("death_date", date(2018, 1, 1), "ABOUT")
        profile2.setCheckedDate("death_date", date(2018, 8, 24), "EXACT")
        profile2.setCheckedDate("baptism_date", date(2017, 1, 1), "ABOUT")
        profile.setComments("comment1")
        profile2.setComments("comment2")
        profile.setWebReference("THIS")
        profile2.setWebReference("OTHER")
        profile.gen_data["birth_place"] = {}
        profile.gen_data["birth_place"]["raw"] = "a"
        profile2.setPlaces("birth_place", GENERIC_PLACE_WITH_PLACE)

        result = profile.merge_profile(profile2,
                                       language="es",
                                       convention="spanish_surname")

        assert (result)
        assert (profile.gen_data["name"] == "Juana")
        assert (profile.gen_data["surname"] == "de Bargas Gómez")
        assert (profile.gen_data["birth_date"] == date(2016, 4, 23))
        assert (profile.gen_data["accuracy_birth_date"] == "EXACT")
        assert (profile.gen_data["comments"] == "comment1\ncomment2")
        assert ("THIS" in profile.gen_data["web_ref"])
        assert ("OTHER" in profile.gen_data["web_ref"])
        assert (profile.gen_data["death_date"] == date(2018, 8, 24))
        assert (profile.gen_data["accuracy_death_date"] == "EXACT")
        assert (profile.gen_data["baptism_date"] == date(2017, 1, 1))
        assert (profile.gen_data["accuracy_baptism_date"] == "ABOUT")
        assert (profile.gen_data["birth_place"]["city"] == "La Parrilla")

        profile3 = gen_profile("Juana", "Bargas")
        profile4 = gen_profile("Facundo", "Smith")
        result2 = profile3.merge_profile(profile4,
                                         language="es",
                                         convention="spanish_surname")
        self.assertFalse(result2)
    def test_using_elnortedecastilla(self):
        '''
        Test checking el Norte de Castilla parser
        '''
        profile = gen_profile("José Luis", "García Martín")
        profile.setCheckedDateWithDates("birth", date(1931, 4, 2), "EXACT")
        reader = elnortedecastilla_reader()
        records = reader.profile_is_matched(profile)
        assert (len(records) > 0)

        pass
Exemple #27
0
 def test_web_reference_adding(self):
     '''
     Testing adding web reference
     '''
     profile = gen_profile("Name", "Surname")
     profile.setWebReference("Myaddress")
     #Wrong declaration in the past created issues
     assert (len(profile.gen_data["web_ref"]) == 1)
     profile.setWebReference(["Myaddress"])
     #This will check the data types is working
     assert (len(profile.gen_data["web_ref"]) == 2)
    def test_introduce_residence_date(self):
        '''
        Testing introduction of residence date
        '''
        profile = gen_profile("Name", "Surname")
        assert (profile.setCheckedDate("birth", 2016, 10, 20))
        assert (profile.setCheckedDate("death", 2019, 12, 31))
        assert (profile.setCheckedDate("residence", 2016, 12, 31))

        assert (not profile.setCheckedDate("residence", 2015, 12, 31))
        assert (not profile.setCheckedDate("residence", 2020, 12, 31))
        assert (not profile.setCheckedDate("burial", 2016, 12, 31, "OTHER"))
    def test_gedcompy_usage(self):
        '''
        Test gedcompy wrapper use
        '''
        date_marr = date(2015, 1, 1)
        husband = gen_profile("Mario", "Vargas")
        husband.setCheckedDate("marriage_date", date_marr, "EXACT")
        wife = gen_profile("María", "Sanz")
        wife.setCheckedDate("marriage_date", date_marr, "EXACT")
        child1 = gen_profile("Francisco", "Vargas Sanz")
        child2 = gen_profile("Roberto", "Vargas Sanz")

        gedcom_profile.convert_gedcom(husband)
        gedcom_profile.convert_gedcom(wife)
        gedcom_profile.convert_gedcom(child1)
        gedcom_profile.convert_gedcom(child2)

        new_gedcom = gedcom_file()
        new_gedcom.add_element(husband.individual)
        new_gedcom.add_element(wife.individual)
        new_gedcom.add_element(child1.individual)
        new_gedcom.add_element(child2.individual)

        assert (husband.return_id() == "@I1@")
        assert (wife.return_id() == "@I2@")
        assert (child1.return_id() == "@I3@")
        assert (child2.return_id() == "@I4@")

        new_gedcom.create_family(husband, wife, [child1, child2])

        for ele in new_gedcom.__dict__["root_elements"]:
            if ele.tag == "FAM":
                for member in ele.__dict__['child_elements']:
                    if (member.tag == "HUSB"): assert (member.value == '@I1@')
                    if (member.tag == "WIFE"): assert (member.value == '@I2@')
                    if (member.tag == "CHILD"):
                        assert (member.value in ['@I3@', '@I4@'])
                    if (member.tag == "MARR"):
                        marr = member.__dict__['child_elements'][0]
                        assert (marr.value == "01 JAN 2015")
 def test_reading_an_input(self):
     profile = gen_profile("José", "García Martín")
     reader = rememori_reader()
     records = reader.profile_is_matched(profile)
     date1 = date(2016, 4, 2)
     date2 = date(2014, 12, 28)
     date1_found = False
     date2_found = False
     for profile in records:
         if (profile.gen_data["death_date"] == date1): date1_found = True
         if (profile.gen_data["death_date"] == date2): date2_found = True
     assert (date1_found)
     assert (date2_found)