Builds two same source objects in a row examines speeds of both
(self)
| 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 | |
| 347 | class UrlTestCase(unittest.TestCase): |
no test coverage detected