def test_rss_feed_non_200(self): url = 'http://example1.%s.com' % utils.random_string() manager = RSSManager(logging, None, None) httpretty.register_uri(httpretty.GET, url, body=history_on_fire.DATA, status=400) with self.assertRaises(HathorException) as error: manager.broadcast_update(url) self.check_error_message('Getting invalid status code:400 for rss feed', error)
def test_rss_feed(self): url = 'http://example.%s.com' % utils.random_string() manager = RSSManager(logging, None, None) httpretty.register_uri(httpretty.GET, url, body=history_on_fire.DATA) episodes = manager.broadcast_update(url) self.assert_length(episodes, 12) for ep in episodes: self.assert_dictionary(ep)