1
0
mirror of https://github.com/balkian/bitter.git synced 2025-08-30 07:12:20 +00:00

Py2 compatibility and queue handling

* Removed install_aliases(), which caused problems with urllib2
* Better waiting time calculation (used in queue handling)
This commit is contained in:
J. Fernando Sánchez
2016-11-23 12:27:53 +01:00
parent 67ef307cce
commit e3a78968da
7 changed files with 45 additions and 25 deletions

View File

@@ -6,7 +6,7 @@ import datetime
import time
from bitter import utils
from bitter.crawlers import TwitterQueue, TwitterWorker, TwitterQueueException
from bitter.crawlers import TwitterQueue, TwitterWorker, QueueException
from bitter import config as c
class TestUtils(TestCase):
@@ -64,12 +64,9 @@ class TestUtils(TestCase):
try:
# resp = self.wq.friends.list(screen_name='balkian')
self.wq.next(['friends', 'list'])
except TwitterQueueException:
except QueueException:
failed = True
assert failed
l2 = w1.get_limit(['friends', 'list'])
assert self.wq.get_wait(['friends', 'list']) > (l2['reset']-time.time())
assert self.wq.get_wait(['friends', 'list']) < (l2['reset']-time.time()+2)
time.sleep(w1.get_wait(['friends', 'list']))