Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (room_scrape) B:\MegaSync\Programming\Python\room_scrape\Scripts>py.test
- ============================= test session starts =============================
- platform win32 -- Python 2.7.11, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
- rootdir: B:\MegaSync\Programming\Python\room_scrape\Scripts, inifile:
- collected 1 items
- test_main.py F
- ================================== FAILURES ===================================
- _____________________________ test_page_response ______________________________
- def test_page_response():
- test_url = ""
- > assert str(get_page(test_url)) == "<Response [200]>"
- test_main.py:7:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- main.py:51: in get_page
- page = requests.get(search_url)
- ..\lib\site-packages\requests\api.py:71: in get
- return request('get', url, params=params, **kwargs)
- ..\lib\site-packages\requests\api.py:57: in request
- return session.request(method=method, url=url, **kwargs)
- ..\lib\site-packages\requests\sessions.py:461: in request
- prep = self.prepare_request(req)
- ..\lib\site-packages\requests\sessions.py:394: in prepare_request
- hooks=merge_hooks(request.hooks, self.hooks),
- ..\lib\site-packages\requests\models.py:295: in prepare
- self.prepare_url(url, params)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <PreparedRequest [GET]>, url = '', params = OrderedDict()
- def prepare_url(self, url, params):
- """Prepares the given HTTP URL."""
- #: Accept objects that have string representations.
- #: We're unable to blindly call unicode/str functions
- #: as this will include the bytestring indicator (b'')
- #: on python 3.x.
- #: https://github.com/kennethreitz/requests/pull/2238
- if isinstance(url, bytes):
- url = url.decode('utf8')
- else:
- url = unicode(url) if is_py2 else str(url)
- # Don't do any URL preparation for non-HTTP schemes like `mailto`,
- # `data` etc to work around exceptions from `url_parse`, which
- # handles RFC 3986 only.
- if ':' in url and not url.lower().startswith('http'):
- self.url = url
- return
- # Support for unicode domain names and paths.
- try:
- scheme, auth, host, port, path, query, fragment = parse_url(url)
- except LocationParseError as e:
- raise InvalidURL(*e.args)
- if not scheme:
- error = ("Invalid URL {0!r}: No schema supplied. Perhaps you meant h
- ttp://{0}?")
- error = error.format(to_native_string(url, 'utf8'))
- > raise MissingSchema(error)
- E MissingSchema: Invalid URL '': No schema supplied. Perhaps you meant
- http://?
- ..\lib\site-packages\requests\models.py:355: MissingSchema
- ========================== 1 failed in 0.67 seconds ===========================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement