def test_valid1(self): ''' Test extraneous tweets are ignored ''' poem = haiku.haiku('haiku_test3') print poem poem = [t.text for t in poem.tweets] self.assertTrue( (poem[0] == '5 syllable line' and poem[2] == '5 syllable lines') or (poem[2] == '5 syllable line' and poem[0] == '5 syllable lines')) self.assertTrue(poem[1] == 'a seven syllable line')
def test_valid(self): ''' Test a valid amount of tweets ''' poem = haiku.haiku("haiku_test1") poem = [t.text for t in poem.tweets] print poem self.assertTrue((poem[0] == '5 syllable line(1)' and poem[2] == '5 syllable line(2)') or (poem[2] == '5 syllable line(1)' and poem[0] == '5 syllable line(2)')) self.assertTrue(poem[1] == 'a seven syllable line')