def test_insertTweetSearchCounter(self):
     global status
     bf = Buffer(10, 10, "myhost", 100, True)
     for i in range(0, 11):
         status["id"] = i
         status["user"]["id"] = i
         bf.insertTweetSearch(status, 1)
     self.assertEqual(len(bf.localBuffer.tweetList.getList()), 0)
     self.assertEqual(len(bf.localBuffer.userList.getList()), 0)
     self.assertEqual(len(bf.localBuffer.tweetSearchList.getList()), 0)
 def test_insertTweetSearchTimerActive(self):
     global status
     bf = Buffer(10, 10, "myhost", 100, True)
     start = time.time()
     bf.startTimer()
     for i in range(0, 5):
         status["id"] = i
         status["user"]["id"] = i
         bf.insertTweetSearch(status, 1)
     end = time.time()
     diff = end - start
     time.sleep(10)
     self.assertEqual(len(bf.localBuffer.tweetList.getList()), 0)
     bf.stopTimer()