def test_get_downloader(self):
        # Test
        downloader = factory.get_downloader('file://localhost', None, None, None, None)

        # Verify
        self.assertTrue(downloader is not None)
        self.assertTrue(isinstance(downloader, LocalDownloader))
Exemple #2
0
    def _create_downloader(self):
        """
        Uses the configuratoin to determine which downloader style to use
        for this run.

        :return: one of the *Downloader classes in the downloaders module
        """

        feed = self.config.get(constants.CONFIG_FEED)
        downloader = downloader_factory.get_downloader(feed, self.repo, self.sync_conduit,
                                                       self.config, self.is_cancelled_call)
        return downloader
 def test_get_downloader_unsupported_feed_type(self):
     try:
         factory.get_downloader('jdob://localhost', None, None, None, None)
         self.fail()
     except UnsupportedFeedType, e:
         self.assertEqual(e.feed_type, 'jdob')
 def test_get_downloader_invalid_feed(self):
     try:
         factory.get_downloader(None, None, None, None, None)
         self.fail()
     except InvalidFeed, e:
         self.assertEqual(e.feed, None)