def stage_builds(self):
        self._local_builds = [ ]

        for build in self._config['settings']['builds']:
            scraper = ReleaseScraper(directory=self.staging_path,
                                     version=build)
            scraper.download()
            self._local_builds.append(scraper.target)
Ejemplo n.º 2
0
def test_release_scraper(httpd, tmpdir, args, filename, url):
    """Testing various download scenarios for ReleaseScraper"""

    scraper = ReleaseScraper(destination=str(tmpdir),
                             base_url=httpd.get_url(),
                             **args)
    expected_filename = os.path.join(str(tmpdir), filename)
    assert scraper.filename == expected_filename
    assert unquote(scraper.url) == urljoin(httpd.get_url(), url)
    def test_scraper(self):
        """Testing various download scenarios for ReleaseScraper"""

        for entry in tests:
            scraper = ReleaseScraper(directory=self.temp_dir,
                                     base_url=self.wdir,
                                     log_level='ERROR',
                                     **entry['args'])
            expected_target = os.path.join(self.temp_dir, entry['target'])
            self.assertEqual(scraper.target, expected_target)
            self.assertEqual(urllib.unquote(scraper.final_url),
                             urljoin(self.wdir, entry['target_url']))
Ejemplo n.º 4
0
    def test_scraper(self):
        """Testing various download scenarios for ReleaseScraper"""

        for entry in tests:
            scraper = ReleaseScraper(destination=self.temp_dir,
                                     base_url=self.wdir,
                                     logger=self.logger,
                                     **entry['args'])
            expected_filename = os.path.join(self.temp_dir, entry['filename'])
            self.assertEqual(scraper.filename, expected_filename)
            self.assertEqual(urllib.unquote(scraper.url),
                             urljoin(self.wdir, entry['url']))