Пример #1
0
    def test_get_downloader(self):
        # Test
        downloader = factory.get_downloader('file://localhost', None, None, None)

        # Verify
        self.assertTrue(downloader is not None)
        self.assertTrue(isinstance(downloader, LocalDownloader))
Пример #2
0
    def test_get_downloader(self):
        # Test
        downloader = factory.get_downloader('file://localhost', None, None,
                                            None)

        # Verify
        self.assertTrue(downloader is not None)
        self.assertTrue(isinstance(downloader, LocalDownloader))
Пример #3
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)
        return downloader_factory.get_downloader(feed, self.repo, self.sync_conduit, self.config)
Пример #4
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)
        return downloader_factory.get_downloader(feed, self.repo, self.sync_conduit, self.config)
Пример #5
0
 def test_get_downloader_unsupported_feed_type(self):
     try:
         factory.get_downloader('jdob://localhost', None, None, None)
         self.fail()
     except UnsupportedFeedType, e:
         self.assertEqual(e.feed_type, 'jdob')
Пример #6
0
 def test_get_downloader_invalid_feed(self):
     try:
         factory.get_downloader(None, None, None, None)
         self.fail()
     except InvalidFeed, e:
         self.assertEqual(e.feed, None)
Пример #7
0
 def test_get_downloader_unsupported_feed_type(self):
     try:
         factory.get_downloader('jdob://localhost', None, None, None)
         self.fail()
     except UnsupportedFeedType, e:
         self.assertEqual(e.feed_type, 'jdob')
Пример #8
0
 def test_get_downloader_invalid_feed(self):
     try:
         factory.get_downloader(None, None, None, None)
         self.fail()
     except InvalidFeed, e:
         self.assertEqual(e.feed, None)