Exemple #1
0
 def test_valid_dates(self):
     # valid date inputs
     # mom and dad die more than one year after child's birth, making both dates valid
     self.assertTrue(
         birth_before_death(birthdate='31 DEC 1999',
                            momdeath='1 JAN 2000',
                            daddeath='1 JAN 2000'))
Exemple #2
0
 def test_both_invalid(self):
     # invalid date inputes
     # mom and dad both dead before birth
     self.assertFalse(
         birth_before_death(birthdate='31 DEC 1999',
                            momdeath='31 DEC 1998',
                            daddeath='31 DEC 1998'))
Exemple #3
0
 def test_invalid_mom_date(self):
     # invalid date inputs
     # mom dies day before child's birth
     self.assertFalse(
         birth_before_death(birthdate='31 DEC 1999',
                            momdeath='30 DEC 1999',
                            daddeath='NA'))
Exemple #4
0
 def test_invalid_dad_date(self):
     # invalid date inputs
     # dad dies a year before child's birth
     self.assertFalse(
         birth_before_death(birthdate='31 DEC 1999',
                            momdeath='NA',
                            daddeath='31 DEC 1998'))
Exemple #5
0
 def test_no_deaths(self):
     # valid date inputs
     # mother and father both still alive, meaning they did not die before child's birth
     self.assertTrue(
         birth_before_death(birthdate='31 DEC 1999',
                            momdeath='NA',
                            daddeath='NA'))