コード例 #1
0
 def test_urls(self):
     ''' Ensure the poems have the correct urls attached '''
     poem = limerick('limerick_test1')
     poem = [t.url for t in poem.tweets]
     self.assertTrue(poem[0] == 'url1')
     self.assertTrue(poem[1] == 'url2')
     self.assertTrue(poem[2] == 'url3')
     self.assertTrue(poem[3] == 'url4')
     self.assertTrue(poem[4] == 'url5')
コード例 #2
0
 def test_valid_variance(self):
     ''' Limerick should choose lines that have similar syllable counts '''
     poem = limerick('limerick_test1')
     poem = [t.text for t in poem.tweets]
     self.assertTrue(poem[0] == "The limerick packs laughs anatomical")
     self.assertTrue(poem[1] == "Into space that is quite economical")
     self.assertTrue(poem[2] == "But the good ones I've seen")
     self.assertTrue(poem[3] == "So seldom are clean")
     self.assertTrue(poem[4] == "And the clean ones so seldom are comical")
コード例 #3
0
 def test_valid(self):
     ''' Test a valid amount of tweets '''
     poem = limerick('limerick_test1')
     poem = [t.text for t in poem.tweets]
     self.assertTrue(poem[0] == "The limerick packs laughs anatomical")
     self.assertTrue(poem[1] == "Into space that is quite economical")
     self.assertTrue(poem[2] == "But the good ones I've seen")
     self.assertTrue(poem[3] == "So seldom are clean")
     self.assertTrue(poem[4] == "And the clean ones so seldom are comical")
コード例 #4
0
 def test_urls(self):
     ''' Ensure the poems have the correct urls attached '''
     poem = limerick('limerick_test1')
     poem = [t.url for t in poem.tweets]
     self.assertTrue(poem[0] == 'url1')
     self.assertTrue(poem[1] == 'url2')
     self.assertTrue(poem[2] == 'url3')
     self.assertTrue(poem[3] == 'url4')
     self.assertTrue(poem[4] == 'url5')
コード例 #5
0
 def test_valid_variance(self):
     ''' Limerick should choose lines that have similar syllable counts '''
     poem = limerick('limerick_test1')
     poem = [t.text for t in poem.tweets]
     self.assertTrue(poem[0] == "The limerick packs laughs anatomical")
     self.assertTrue(poem[1] == "Into space that is quite economical")
     self.assertTrue(poem[2] == "But the good ones I've seen")
     self.assertTrue(poem[3] == "So seldom are clean")
     self.assertTrue(poem[4] == "And the clean ones so seldom are comical")
コード例 #6
0
 def test_valid(self):
     ''' Test a valid amount of tweets '''
     poem = limerick('limerick_test1')
     poem = [t.text for t in poem.tweets]
     self.assertTrue(poem[0] == "The limerick packs laughs anatomical")
     self.assertTrue(poem[1] == "Into space that is quite economical")
     self.assertTrue(poem[2] == "But the good ones I've seen")
     self.assertTrue(poem[3] == "So seldom are clean")
     self.assertTrue(poem[4] == "And the clean ones so seldom are comical")