Skip to content

Commit

Permalink
Merge branch 'hotfix/0.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
clemfromspace committed Sep 6, 2018
2 parents 7b01d7a + c369228 commit 7b1bc92
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions requirements/requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ pytest==3.4.0
coverage<4.4
pytest-cov==2.4.0
codeclimate-test-reporter==0.2.3
attrs>=17.4.0
2 changes: 1 addition & 1 deletion scrapy_selenium/middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def process_request(self, request, spider):
"""Process a request using the selenium driver if applicable"""

if not isinstance(request, SeleniumRequest):
return request
return None

self.driver.get(request.url)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = scrapy-selenium
version = 0.0.3
version = 0.0.4
url = https://github.com/clemfromspace/scrapy-selenium
licence = DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
description = Scrapy with selenium
Expand Down
9 changes: 4 additions & 5 deletions tests/test_middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,16 @@ def test_spider_closed_should_close_the_driver(self):

mocked_quit.assert_called_once()

def test_process_request_should_return_the_request_if_not_selenium_request(self):
"""Test that the ``process_request`` should return a request if not selenium request"""
def test_process_request_should_return_none_if_not_selenium_request(self):
"""Test that the ``process_request`` should return none if not selenium request"""

scrapy_request = Request(url='http://not-an-url')

self.assertEqual(
self.assertIsNone(
self.selenium_middleware.process_request(
request=scrapy_request,
spider=None
),
scrapy_request
)
)

def test_process_request_should_return_a_response_if_selenium_request(self):
Expand Down

0 comments on commit 7b1bc92

Please sign in to comment.