def test_same_send(self):
     ''' Tests that identical tweets are properly handled '''
     tweet1 = Tweet("text 1", "something.something", "corn")
     tweet2 = Tweet("text 1", "something.something", "corn")
     tweets = [tweet1, tweet2]
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)
     self.assertEqual(poem.hashtag, tweet1.hashtag)
 def test_newline_send(self):
     ''' Tests that newlines are appropriately handled '''
     tweet1 = Tweet("text 1\n", "something.something", "corn")
     tweet2 = Tweet("text 2\n", "somethingelse.something", "corn")
     tweets = [tweet1, tweet2]
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)
     self.assertEqual(poem.hashtag, tweet1.hashtag)
 def test_empty_send(self):
     ''' Tests that empty strings are properly handled '''
     tweet1 = Tweet("", "something.something", "corn")
     tweet2 = Tweet("", "somethingelse.something", "corn")
     tweets = [tweet1, tweet2]
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)
     self.assertEqual(poem.hashtag, tweet1.hashtag)
Example #4
0
 def test_same_send(self):
     ''' Tests that identical tweets are properly handled '''
     tweet1 = Tweet("text 1", "something.something", "corn")
     tweet2 = Tweet("text 1", "something.something", "corn")
     tweets = [tweet1, tweet2]
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)
     self.assertEqual(poem.hashtag, tweet1.hashtag)
 def test_basic_send(self):
     ''' Tests a basic tweet is sent '''
     tweet1 = Tweet("text 1", "something.something", "corn")
     tweet2 = Tweet("text 2", "somethingelse.something", "corn")
     tweets = [tweet1, tweet2]
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)
     self.assertEqual(poem.hashtag, tweet1.hashtag)
Example #6
0
 def test_empty_send(self):
     ''' Tests that empty strings are properly handled '''
     tweet1 = Tweet("", "something.something", "corn")
     tweet2 = Tweet("", "somethingelse.something", "corn")
     tweets = [tweet1, tweet2]
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)
     self.assertEqual(poem.hashtag, tweet1.hashtag)
Example #7
0
 def test_newline_send(self):
     ''' Tests that newlines are appropriately handled '''
     tweet1 = Tweet("text 1\n", "something.something", "corn")
     tweet2 = Tweet("text 2\n", "somethingelse.something", "corn")
     tweets = [tweet1, tweet2]
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)
     self.assertEqual(poem.hashtag, tweet1.hashtag)
Example #8
0
 def test_basic_send(self):
     ''' Tests a basic tweet is sent '''
     tweet1 = Tweet("text 1", "something.something", "corn")
     tweet2 = Tweet("text 2", "somethingelse.something", "corn")
     tweets = [tweet1, tweet2]
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)
     self.assertEqual(poem.hashtag, tweet1.hashtag)
Example #9
0
def sendtweet():
    """request to submit a generated poem to twitter"""
    print "sending tweet"
    print request.form["id"]
    twitter = connect()
    poem = Poem.query.filter_by(id=request.form["id"]).first()
    if poem is None:
    	abort(404)
    sendPoem(twitter, poem)
    print "send success"
    return redirect(url_for("poem", id=str(poem.id)))
 def test_zero_send(self):
     ''' Tests on an empty list of tweets '''
     tweets = []
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)
Example #11
0
 def test_zero_send(self):
     ''' Tests on an empty list of tweets '''
     tweets = []
     poem = Poem(tweets, "corn", "couplet")
     sendPoem(self.twitter, poem)