Beispiel #1
0
 def test_consider_retweets_protected_does_not_retweet(self):
     self.faux_tweets[0]['protected'] = True
     self.mock_CLS.classify.return_value = [[0, 1]]
     brain._consider_retweets(self.faux_tweets)
     self.assertFalse(self.mock_twitter.retweet.called)
Beispiel #2
0
 def test_consider_retweets_below_threshold_does_not_retweet(self):
     self.mock_CLS.classify.return_value = [[1, 0]]
     brain._consider_retweets(self.faux_tweets)
     self.assertFalse(self.mock_twitter.retweet.called)
Beispiel #3
0
 def test_consider_retweets_max_retweets_does_not_retweet(self):
     self.faux_config.max_retweets = 0
     self.mock_CLS.classify.return_value = [[0, 1]]
     brain._consider_retweets(self.faux_tweets)
     self.assertFalse(self.mock_twitter.retweet.called)
Beispiel #4
0
 def test_consider_retweets_above_threshold_does_retweet(self):
     self.mock_CLS.classify.return_value = [[0, 1]]
     brain._consider_retweets(self.faux_tweets)
     self.mock_twitter.retweet.assert_called_with(1234)
Beispiel #5
0
 def test_consider_retweets_protected_does_not_retweet(self):
     self.faux_tweets[0]['protected'] = True
     self.mock_CLS.classify.return_value = [[0,1]]
     brain._consider_retweets(self.faux_tweets)
     self.assertFalse(self.mock_twitter.retweet.called)
Beispiel #6
0
 def test_consider_retweets_max_retweets_does_not_retweet(self):
     self.faux_config.max_retweets = 0
     self.mock_CLS.classify.return_value = [[0,1]]
     brain._consider_retweets(self.faux_tweets)
     self.assertFalse(self.mock_twitter.retweet.called)
Beispiel #7
0
 def test_consider_retweets_below_threshold_does_not_retweet(self):
     self.mock_CLS.classify.return_value = [[1,0]]
     brain._consider_retweets(self.faux_tweets)
     self.assertFalse(self.mock_twitter.retweet.called)
Beispiel #8
0
 def test_consider_retweets_above_threshold_does_retweet(self):
     self.mock_CLS.classify.return_value = [[0,1]]
     brain._consider_retweets(self.faux_tweets)
     self.mock_twitter.retweet.assert_called_with(1234)