Skip to content

Commit

Permalink
tests: Test removal of leading slash from asset names
Browse files Browse the repository at this point in the history
  • Loading branch information
ljanyst committed Feb 3, 2019
1 parent fe02f5c commit a24348e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_webservices.py
Expand Up @@ -400,12 +400,13 @@ def test_web_app(self):
controller = Mock()
request = Mock()
with patch('scrapy_do.webservice.get_data') as get_data:
get_data.return_value = b'{"foo": "bar"}'
get_data.return_value = b'{"foo": "bar", "foo1": "/bar1"}'
web_app = WebApp(config, controller)
request.uri = b'/foo'
index = web_app.getChild(None, request)
self.assertEqual(index, web_app.index)
request.uri = b'/favicon.png'
favicon = web_app.getChild(None, request)
self.assertNotEqual(favicon, web_app.index)
self.assertEqual(favicon.render_GET(request), b'{"foo": "bar"}')
self.assertEqual(favicon.render_GET(request),
b'{"foo": "bar", "foo1": "/bar1"}')

0 comments on commit a24348e

Please sign in to comment.