예제 #1
0
 def test_process_response_imgs(self):
     host_url = 'http://www.davidcmoss.co.uk/'
     content = "<img src='test.png' />"
     response = Response()
     response.url = host_url
     response._content = content
     page = process_response(host_url, response)
     assert host_url + 'test.png' in page.images
예제 #2
0
 def test_process_response_ex_links(self):
     host_url = 'http://www.davidcmoss.co.uk/'
     content = "<a href='http://google.com' />"
     response = Response()
     response.url = host_url
     response._content = content
     page = process_response(host_url, response)
     assert 'http://google.com' in page.ex_links
예제 #3
0
 def test_process_response_links(self):
     host_url = 'http://www.davidcmoss.co.uk/'
     content = "<a href='/test' />"
     response = Response()
     response.url = host_url
     response._content = content
     page = process_response(host_url, response)
     assert host_url + 'test' in page.links
예제 #4
0
파일: tests.py 프로젝트: davidmoss/crawler
 def test_process_response_imgs(self):
     host_url = 'http://www.davidcmoss.co.uk/'
     content = "<img src='test.png' />"
     response = Response()
     response.url = host_url
     response._content = content
     page = process_response(host_url, response)
     assert host_url + 'test.png' in page.images
예제 #5
0
파일: tests.py 프로젝트: davidmoss/crawler
 def test_process_response_ex_links(self):
     host_url = 'http://www.davidcmoss.co.uk/'
     content = "<a href='http://google.com' />"
     response = Response()
     response.url = host_url
     response._content = content
     page = process_response(host_url, response)
     assert 'http://google.com' in page.ex_links
예제 #6
0
파일: tests.py 프로젝트: davidmoss/crawler
 def test_process_response_links(self):
     host_url = 'http://www.davidcmoss.co.uk/'
     content = "<a href='/test' />"
     response = Response()
     response.url = host_url
     response._content = content
     page = process_response(host_url, response)
     assert host_url + 'test' in page.links