def test_workerSleep(self):
        """
        twitter collector should sleep if not keywords found
        """
        RawStreamQueue.drop_collection()
        SocketSession.drop_collection()
        kill = threading.Event()

        self.assertEqual(len(SocketSession.get_keywords()), 0)
        w = TwitterWorker(kill)
        w.setDaemon(True)
        w.start()
        time.sleep(1)
        kill.set()
        self.assertEqual(RawStreamQueue.objects.count(), 0)
    def test_workerSleep(self):
        """
        twitter collector should sleep if not keywords found
        """
        RawStreamQueue.drop_collection()
        SocketSession.drop_collection()
        kill = threading.Event()

        self.assertEqual(len(SocketSession.get_keywords()),0)
        w = TwitterWorker(kill)
        w.setDaemon(True)
        w.start()
        time.sleep(1)
        kill.set()
        self.assertEqual(RawStreamQueue.objects.count(), 0)
Ejemplo n.º 3
0
 def tearDown(self):
     RawStreamQueue.drop_collection()
     SocketSession.drop_collection()
Ejemplo n.º 4
0
 def tearDown(self):
     RawStreamQueue.drop_collection()
     SocketSession.drop_collection()
 def tearDown(self):
     ClassifiedStream.drop_collection()
     RawStreamQueue.drop_collection()
Ejemplo n.º 6
0
 def tearDown(self):
     ClassifiedStream.drop_collection()
     RawStreamQueue.drop_collection()