예제 #1
0
 def testChildrenWithoutIndis(self):
     list_of_children = ['Oldest', 'Fake', 'Youngest']
     list_of_indis = [
         Individual(indi='Oldest', age=11),
         Individual(indi='Youngest', age=2)
     ]
     desired_result = ['Oldest', 'Youngest']
     self.assertListEqual(
         order_siblings_by_age(list_of_children, list_of_indis),
         desired_result)
예제 #2
0
 def testManyChildren(self):
     list_of_children = ['1', '2', '3', '4', '5']
     list_of_indis = [
         Individual(indi='1', age=1),
         Individual(indi='2', age=2),
         Individual(indi='3', age=3),
         Individual(indi='4', age=4),
         Individual(indi='5', age=5)
     ]
     desired_result = ['5', '4', '3', '2', '1']
     self.assertListEqual(
         order_siblings_by_age(list_of_children, list_of_indis),
         desired_result)
예제 #3
0
 def testNoIndisOrChildren(self):
     list_of_children = []
     list_of_indis = []
     self.assertListEqual(
         order_siblings_by_age(list_of_children, list_of_indis), [])
예제 #4
0
 def testNoChildren(self):
     list_of_children = []
     list_of_indis = [Individual(indi='01', age=49)]
     self.assertListEqual(
         order_siblings_by_age(list_of_children, list_of_indis), [])
예제 #5
0
 def testOneChild(self):
     list_of_children = ['OnlyChild']
     list_of_indis = [Individual(indi='OnlyChild', age=11, child='F01')]
     desired_result = ['OnlyChild']
     actual = order_siblings_by_age(list_of_children, list_of_indis)
     self.assertListEqual(actual, desired_result)