def test_verse_9(self): self.assertEqual( Xmas.get_verse(9), 'On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' )
def test_verse_12(self): self.assertEqual( Xmas.get_verse(12), 'On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' )
def test_verse_7(self): self.assertEqual( Xmas.get_verse(7), 'On the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' )
def test_verse_1(self): self.assertEqual( Xmas.get_verse(1), 'On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.' )
def test_verse_5(self): self.assertEqual( Xmas.get_verse(5), 'On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' )
def test_verse_3(self): self.assertEqual( Xmas.get_verse(3), 'On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' )
def test_verse_wrong_type(self): with self.assertRaises(TypeError): Xmas.get_verse([])
def test_verse_2(self): self.assertEqual( Xmas.get_verse(2), 'On the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.' )
def test_verse_out_of_range(self): with self.assertRaises(IndexError): Xmas.get_verse(-1)