def setUp(self): self.db = app.create_large_db(database_path) self.query = app.get_query('Twitter',self.db) self.date_list = sentiment.get_sentiment(self.query)[0] self.pos_sentiment_list = sentiment.get_sentiment(self.query)[1] self.neg_sentiment_list = sentiment.get_sentiment(self.query)[2] self.total_search = sentiment.get_sentiment(self.query)[3] self.hash_list = sentiment.get_sentiment(self.query)[4] self.months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
def test_search_and_confirm_structure(self): query = app.get_query('Twitter',self.db) if len(query) > 0: for content in query: self.assertTrue(hasattr(content, 'sentiment'),'Content has no sentiment attribute') self.assertTrue(hasattr(content, 'user_id'),'Content has no user_id attribute') self.assertTrue(hasattr(content, 'created_at'),'Content has no created_at attribute') self.assertTrue(hasattr(content, 'text'),'Content has no text attribute') self.assertTrue(hasattr(content, 'hashtags'),'Content has no hashtags attribute') self.assertTrue(hasattr(content, 'user_mentions'),'Content has no user_mentions attribute') self.assertFalse(hasattr(content, 'Scooby'),'Content a Scooby attribute??') break
def test_search_I(self): query = app.get_query('I',self.db)
def test_search_escape(self): query = app.get_query('/\fdewq',self.db)
def test_search_dash(self): query = app.get_query('--ffsag',self.db)
def test_search_space(self): query = app.get_query('bdsfga FSFVA',self.db)
def test_search_123(self): query = app.get_query('123',self.db)
def test_search_Hello(self): query = app.get_query('Hello',self.db)