Example #1
0
 def test_grade_strip(self):
     haiku = Haiku(poem="One line\n\n  \nTwo lines\nThree lines\n   \n   ")
     self.assertEquals(haiku.get_grade(), 3.0 / 3)
Example #2
0
 def test_grade_two(self):
     haiku = Haiku(poem="One line\nTwo lines")
     self.assertEquals(haiku.get_grade(), 2.0 / 3)
Example #3
0
 def test_grade_four(self):
     haiku = Haiku(poem="One line\nTwo lines\nThree lines\nFour lines")
     self.assertEquals(haiku.get_grade(), 0)
Example #4
0
 def test_grade_one(self):
     haiku = Haiku(poem="One line")
     self.assertEquals(haiku.get_grade(), 1.0 / 3)