Ejemplo n.º 1
0
    def test_finds_wordpress_feeds(self):
        # Mock to look like a Wordpress feed.
        def side_effect(param):
            return mock_feed if param == 'http://test.com/feed' else mock_page

        self.mock_get.side_effect = side_effect
        feed_url = feedfinder.feeds('http://test.com')
        self.assertEqual(feed_url, ['http://test.com/feed'])
Ejemplo n.º 2
0
    def test_finds_wordpress_feeds(self):
        # Mock to look like a Wordpress feed.
        def side_effect(param):
            return mock_feed if param == 'http://test.com/feed' else mock_page

        self.mock_get.side_effect = side_effect
        feed_url = feedfinder.feeds('http://test.com')
        self.assertEqual(feed_url, ['http://test.com/feed'])
Ejemplo n.º 3
0
def find_feeds(url):
    """
    Find the RSS feed urls for a site.
    Returns all eligible feeds.

    Args:
        | url (str)    -- the url of the site to search.

    Returns:
        | list -- a list of the feed urls.
    """
    return feedfinder.feeds(url)
Ejemplo n.º 4
0
 def test_finds_feeds_if_already_feed(self):
     self.mock_get.return_value = mock_feed
     feed_url = feedfinder.feeds('http://test.com')
     self.assertEqual(feed_url, ['http://test.com'])
Ejemplo n.º 5
0
 def test_finds_feeds_if_already_feed(self):
     self.mock_get.return_value = mock_feed
     feed_url = feedfinder.feeds('http://test.com')
     self.assertEqual(feed_url, ['http://test.com'])