def no_name_birthdate(self): individuals = { 'I01': Individual('I01', name=None, sex=None, birth=None, death=None, famc=None, fams=None), 'I02': Individual('I02', name=None, sex=None, birth=None, death=None, famc=None, fams=None), 'I03': Individual('I03', name=None, sex=None, birth=None, death=None, famc=None, fams=None) } families = {} parser = TestParser(individuals, families) self.assertEqual(len(US23.unique_names_and_birth_date(parser)), 2)
def all_unique(self): individuals = { 'I01': Individual('I01', name='John 1', sex=None, birth=date(2013, 4, 14), death=None, famc=None, fams=None), 'I02': Individual('I02', name='John 2', sex=None, birth=date(1994, 5, 16), death=None, famc=None, fams=None), 'I03': Individual('I03', name='John 3', sex=None, birth=date(2014, 6, 7), death=None, famc=None, fams=None) } families = {} parser = TestParser(individuals, families) self.assertEqual(len(US23.unique_names_and_birth_date(parser)), 0)
def three_not_unique(self): individuals = { 'I01': Individual('I01', name='John', sex=None, birth=date(1994, 5, 16), death=None, famc=None, fams=None), 'I02': Individual('I02', name='John', sex=None, birth=date(1994, 5, 16), death=None, famc=None, fams=None), 'I03': Individual('I03', name='John', sex=None, birth=date(1994, 5, 16), death=None, famc=None, fams=None) } families = {} parser = TestParser(individuals, families) self.assertEqual(len(US23.unique_names_and_birth_date(parser)), 2)