Remove the get_ in method name, doesn't fit rest of api

0.3.0.dev
Richard Harding 12 years ago
parent b78d7e8501
commit 57694cb352

@ -145,7 +145,7 @@ class Document:
def short_title(self):
return shorten_title(self.html)
def get_summary_with_metadata(self, enclose_with_html_tag=True):
def summary_with_metadata(self, enclose_with_html_tag=True):
"""Parse the input content and return a Summary object
:param enclose_with_html_tag: Bool do you want a full <html> document

@ -41,7 +41,7 @@ class TestArticleOnly(unittest.TestCase):
"""We should parse the doc and get a full summary with confidence"""
sample = load_sample('si-game.sample.html')
doc = Document(sample, url='http://sportsillustrated.cnn.com/baseball/mlb/gameflash/2012/04/16/40630_preview.html')
res = doc.get_summary_with_metadata(enclose_with_html_tag=False)
res = doc.summary_with_metadata(enclose_with_html_tag=False)
self.assertTrue(hasattr(res, 'html'), 'res should have an html attrib')
self.assertTrue(hasattr(res, 'confidence'), 'res should have an html attrib')
self.assertEqual('<div><div class="', res.html[0:17])

Loading…
Cancel
Save