MCPcopy
hub / github.com/codelucas/newspaper / test_cache_categories

Method test_cache_categories

tests/unit_tests.py:331–344  ·  view source on GitHub ↗

Builds two same source objects in a row examines speeds of both

(self)

Source from the content-addressed store, hash-verified

329
330 @print_test
331 def test_cache_categories(self):
332 """Builds two same source objects in a row examines speeds of both
333 """
334 url = 'http://uk.yahoo.com'
335 html = mock_resource_with('yahoo_main_site', 'html')
336 s = Source(url)
337 s.download()
338 s.parse()
339 s.set_categories()
340
341 saved_urls = s.category_urls()
342 s.categories = []
343 s.set_categories()
344 assert sorted(s.category_urls()) == sorted(saved_urls)
345
346
347class UrlTestCase(unittest.TestCase):

Callers 1

runTestMethod · 0.95

Calls 6

downloadMethod · 0.95
parseMethod · 0.95
set_categoriesMethod · 0.95
category_urlsMethod · 0.95
SourceClass · 0.90
mock_resource_withFunction · 0.85

Tested by

no test coverage detected