mirror of https://github.com/scrapy/scrapy.git
test_unbounded_response: to_unicode → custom six code
This commit is contained in:
parent
efd72b08f9
commit
d2589c74c5
|
|
@ -1,6 +1,7 @@
|
|||
import json
|
||||
import logging
|
||||
|
||||
import six
|
||||
from testfixtures import LogCapture
|
||||
from twisted.internet import defer
|
||||
from twisted.trial.unittest import TestCase
|
||||
|
|
@ -161,7 +162,11 @@ with multiples lines
|
|||
crawler = self.runner.create_crawler(SimpleSpider)
|
||||
with LogCapture() as l:
|
||||
yield crawler.crawl(self.mockserver.url("/raw?{0}".format(query)), mockserver=self.mockserver)
|
||||
self.assertEqual(to_unicode(l).count("Got response 200"), 1)
|
||||
if six.PY2:
|
||||
message = unicode(l)
|
||||
else:
|
||||
message = str(l)
|
||||
self.assertEqual(message.count("Got response 200"), 1)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_retry_conn_lost(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue