예제 #1
0
파일: __init__.py 프로젝트: fusionbox/eek
 def test_raise_NotHtmlException_on_messed_up_content_type(self):
     from eek.spider import beautify, NotHtmlException
     response = self.MockResponse('foo', '<!doctype html><p>Hello</p>')
     with self.assertRaises(NotHtmlException):
         beautify(response)
예제 #2
0
파일: __init__.py 프로젝트: fusionbox/eek
 def test_return_not_none_encoding(self):
     from eek.spider import beautify
     response = self.MockResponse('text/html; charset=utf-8',
                                  '<!doctype html><p>Hello</p>')
     result = beautify(response)
     self.assertIsNotNone(result.original_encoding)
예제 #3
0
파일: __init__.py 프로젝트: fusionbox/eek
 def test_return_no_encoding(self):
     from eek.spider import beautify
     response = self.MockResponse('text/html',
                                  '<!doctype html><p>Hello</p>')
     result = beautify(response)
     self.assertIsNone(result.fromEncoding)
예제 #4
0
파일: __init__.py 프로젝트: fusionbox/eek
 def test_raise_NotHtmlException_on_messed_up_content_type(self):
     from eek.spider import beautify, NotHtmlException
     response = self.MockResponse('foo',
                                  '<!doctype html><p>Hello</p>')
     with self.assertRaises(NotHtmlException):
         beautify(response)
예제 #5
0
파일: __init__.py 프로젝트: fusionbox/eek
 def test_return_not_none_encoding(self):
     from eek.spider import beautify
     response = self.MockResponse('text/html; charset=utf-8',
                                  '<!doctype html><p>Hello</p>')
     result = beautify(response)
     self.assertIsNotNone(result.original_encoding)
예제 #6
0
파일: __init__.py 프로젝트: fusionbox/eek
 def test_return_no_encoding(self):
     from eek.spider import beautify
     response = self.MockResponse('text/html',
                                  '<!doctype html><p>Hello</p>')
     result = beautify(response)
     self.assertIsNone(result.fromEncoding)