Advertisement
Guest User

Untitled

a guest
May 31st, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. (room_scrape) B:\MegaSync\Programming\Python\room_scrape\Scripts>py.test
  2. ============================= test session starts =============================
  3. platform win32 -- Python 2.7.11, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
  4. rootdir: B:\MegaSync\Programming\Python\room_scrape\Scripts, inifile:
  5. collected 1 items
  6.  
  7. test_main.py F
  8.  
  9. ================================== FAILURES ===================================
  10. _____________________________ test_page_response ______________________________
  11.  
  12. def test_page_response():
  13.  
  14. test_url = ""
  15.  
  16. > assert str(get_page(test_url)) == "<Response [200]>"
  17.  
  18. test_main.py:7:
  19. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  20. main.py:51: in get_page
  21. page = requests.get(search_url)
  22. ..\lib\site-packages\requests\api.py:71: in get
  23. return request('get', url, params=params, **kwargs)
  24. ..\lib\site-packages\requests\api.py:57: in request
  25. return session.request(method=method, url=url, **kwargs)
  26. ..\lib\site-packages\requests\sessions.py:461: in request
  27. prep = self.prepare_request(req)
  28. ..\lib\site-packages\requests\sessions.py:394: in prepare_request
  29. hooks=merge_hooks(request.hooks, self.hooks),
  30. ..\lib\site-packages\requests\models.py:295: in prepare
  31. self.prepare_url(url, params)
  32. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  33.  
  34. self = <PreparedRequest [GET]>, url = '', params = OrderedDict()
  35.  
  36. def prepare_url(self, url, params):
  37. """Prepares the given HTTP URL."""
  38. #: Accept objects that have string representations.
  39. #: We're unable to blindly call unicode/str functions
  40. #: as this will include the bytestring indicator (b'')
  41. #: on python 3.x.
  42. #: https://github.com/kennethreitz/requests/pull/2238
  43. if isinstance(url, bytes):
  44. url = url.decode('utf8')
  45. else:
  46. url = unicode(url) if is_py2 else str(url)
  47.  
  48. # Don't do any URL preparation for non-HTTP schemes like `mailto`,
  49. # `data` etc to work around exceptions from `url_parse`, which
  50. # handles RFC 3986 only.
  51. if ':' in url and not url.lower().startswith('http'):
  52. self.url = url
  53. return
  54.  
  55. # Support for unicode domain names and paths.
  56. try:
  57. scheme, auth, host, port, path, query, fragment = parse_url(url)
  58. except LocationParseError as e:
  59. raise InvalidURL(*e.args)
  60.  
  61. if not scheme:
  62. error = ("Invalid URL {0!r}: No schema supplied. Perhaps you meant h
  63. ttp://{0}?")
  64. error = error.format(to_native_string(url, 'utf8'))
  65.  
  66. > raise MissingSchema(error)
  67. E MissingSchema: Invalid URL '': No schema supplied. Perhaps you meant
  68. http://?
  69.  
  70. ..\lib\site-packages\requests\models.py:355: MissingSchema
  71. ========================== 1 failed in 0.67 seconds ===========================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement