def test_store_compressed_data(self): page = feedfinder.get_page('http://www.fgv.br') cp = downloader.compress_content(page) downloader.ARTICLES.insert({"compressed": cp}) rp = downloader.ARTICLES.find_one() self.assertEqual(page, downloader.decompress_content(rp["compressed"]))
def test_compress_decompress(self): page = feedfinder.get_page('http://www.oglobo.globo.com') cp = downloader.compress_content(page) self.assertEqual(page, downloader.decompress_content(cp))