diff --git a/tests/base_scraper/test_base_scraper.py b/tests/base_scraper/test_base_scraper.py index 3b4ecaf1..36e80f03 100644 --- a/tests/base_scraper/test_base_scraper.py +++ b/tests/base_scraper/test_base_scraper.py @@ -35,7 +35,8 @@ def test_download(self): test_url = urljoin(self.wdir, 'download_test.txt') scraper = mozdownload.DirectScraper(url=test_url, directory=self.temp_dir, - version=None) + version=None, + log_level='ERROR') scraper.download() self.assertTrue(os.path.isfile(os.path.join(self.temp_dir, filename))) @@ -48,7 +49,8 @@ def test_download(self): test_url1 = urljoin(self.wdir, 'does_not_exist.html') scraper1 = mozdownload.DirectScraper(url=test_url1, directory=self.temp_dir, - version=None) + version=None, + log_level='ERROR') self.assertRaises(requests.exceptions.RequestException, scraper1.download) @@ -58,13 +60,14 @@ def test_download(self): directory=self.temp_dir, version=None, retry_attempts=3, - retry_delay=1.0) + retry_delay=1.0, + log_level='ERROR') self.assertRaises(requests.exceptions.RequestException, scraper2.download) def test_notimplementedexceptions(self): scraper = mozdownload.Scraper(directory=self.temp_dir, - version=None) + version=None, log_level='ERROR') for attr in ['binary', 'binary_regex', 'path_regex']: self.assertRaises(mozdownload.NotImplementedError, getattr, scraper, attr) diff --git a/tests/daily_scraper/test_daily_scraper.py b/tests/daily_scraper/test_daily_scraper.py index 691c3999..94f82976 100644 --- a/tests/daily_scraper/test_daily_scraper.py +++ b/tests/daily_scraper/test_daily_scraper.py @@ -17,42 +17,42 @@ {'args': {'platform': 'win32'}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.en-US.win32.installer.exe', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central/firefox-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win32 --branch=mozilla-central {'args': {'platform': 'win32', 'branch': 'mozilla-central'}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.en-US.win32.installer.exe', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central/firefox-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win64 --branch=mozilla-central {'args': {'platform': 'win64', 'branch': 'mozilla-central'}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.en-US.win64-x86_64.installer.exe', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central/firefox-27.0a1.en-US.win64-x86_64.installer.exe' - }, + }, # -p linux --branch=mozilla-central {'args': {'platform': 'linux', - 'branch': 'mozilla-central'}, + 'branch': 'mozilla-central'}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.en-US.linux-i686.tar.bz2', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central/firefox-27.0a1.en-US.linux-i686.tar.bz2' }, # -p linux64 --branch=mozilla-central {'args': {'platform': 'linux64', - 'branch': 'mozilla-central'}, + 'branch': 'mozilla-central'}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.en-US.linux-x86_64.tar.bz2', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central/firefox-27.0a1.en-US.linux-x86_64.tar.bz2' - }, + }, # -p mac --branch=mozilla-central {'args': {'platform': 'mac', - 'branch': 'mozilla-central'}, + 'branch': 'mozilla-central'}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.en-US.mac.dmg', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central/firefox-27.0a1.en-US.mac.dmg' - }, + }, # -p linux --branch=mozilla-central --extension=txt {'args': {'platform': 'linux', @@ -60,7 +60,7 @@ 'extension': 'txt'}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.en-US.linux-i686.txt', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central/firefox-27.0a1.en-US.linux-i686.txt' - }, + }, # -p win32 --branch=mozilla-central -l it {'args': {'platform': 'win32', @@ -68,7 +68,7 @@ 'locale': 'it'}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.it.win32.installer.exe', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central-l10n/firefox-27.0a1.it.win32.installer.exe' - }, + }, # -p win32 --branch=mozilla-central -l sv-SE {'args': {'platform': 'win32', @@ -76,7 +76,7 @@ 'locale': 'sv-SE'}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.sv-SE.win32.installer.exe', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central-l10n/firefox-27.0a1.sv-SE.win32.installer.exe' - }, + }, # -p win32 --branch=mozilla-central --build-id=20130706031213 {'args': {'platform': 'win32', @@ -84,7 +84,7 @@ 'build_id': '20130706031213'}, 'target': '2013-07-06-03-12-13-mozilla-central-firefox-27.0a1.en-US.win32.installer.exe', 'target_url': 'firefox/nightly/2013/07/2013-07-06-03-12-13-mozilla-central/firefox-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win32 --branch=mozilla-central --date=2013-07-02 {'args': {'platform': 'win32', @@ -92,7 +92,7 @@ 'date': '2013-07-02'}, 'target': '2013-07-02-04-12-13-mozilla-central-firefox-27.0a1.en-US.win32.installer.exe', 'target_url': 'firefox/nightly/2013/07/2013-07-02-04-12-13-mozilla-central/firefox-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win32 --branch=mozilla-central --date=2013-07-02 --build-number=1 {'args': {'platform': 'win32', @@ -101,7 +101,7 @@ 'build_number': 1}, 'target': '2013-07-02-03-12-13-mozilla-central-firefox-27.0a1.en-US.win32.installer.exe', 'target_url': 'firefox/nightly/2013/07/2013-07-02-03-12-13-mozilla-central/firefox-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win32 --branch=mozilla-central --stub {'args': {'platform': 'win32', @@ -109,21 +109,21 @@ 'is_stub_installer': True}, 'target': '2013-10-01-03-02-04-mozilla-central-firefox-27.0a1.en-US.win32.installer-stub.exe', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-central/firefox-27.0a1.en-US.win32.installer-stub.exe' - }, + }, # -p win32 --branch=mozilla-aurora {'args': {'platform': 'win32', 'branch': 'mozilla-aurora'}, 'target': '2013-10-01-03-02-04-mozilla-aurora-firefox-27.0a1.en-US.win32.installer.exe', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-mozilla-aurora/firefox-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win32 --branch=ux {'args': {'platform': 'win32', 'branch': 'ux'}, 'target': '2013-10-01-03-02-04-ux-firefox-27.0a1.en-US.win32.installer.exe', 'target_url': 'firefox/nightly/2013/10/2013-10-01-03-02-04-ux/firefox-27.0a1.en-US.win32.installer.exe' - }, + }, ] thunderbird_tests = [ @@ -133,7 +133,7 @@ 'branch': 'comm-central'}, 'target': '2013-10-01-03-02-04-comm-central-thunderbird-27.0a1.en-US.linux-i686.tar.bz2', 'target_url': 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-central/thunderbird-27.0a1.en-US.linux-i686.tar.bz2' - }, + }, # -p linux64 --branch=comm-central {'args': {'application': 'thunderbird', @@ -141,7 +141,7 @@ 'branch': 'comm-central'}, 'target': '2013-10-01-03-02-04-comm-central-thunderbird-27.0a1.en-US.linux-x86_64.tar.bz2', 'target_url': 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-central/thunderbird-27.0a1.en-US.linux-x86_64.tar.bz2' - }, + }, # -p mac --branch=comm-central {'args': {'application': 'thunderbird', @@ -149,7 +149,7 @@ 'branch': 'comm-central'}, 'target': '2013-10-01-03-02-04-comm-central-thunderbird-27.0a1.en-US.mac.dmg', 'target_url': 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-central/thunderbird-27.0a1.en-US.mac.dmg' - }, + }, # -p win32 --branch=comm-central {'args': {'application': 'thunderbird', @@ -157,7 +157,7 @@ 'branch': 'comm-central'}, 'target': '2013-10-01-03-02-04-comm-central-thunderbird-27.0a1.en-US.win32.installer.exe', 'target_url': 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-central/thunderbird-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win64 --branch=comm-central {'args': {'application': 'thunderbird', @@ -165,7 +165,7 @@ 'branch': 'comm-central'}, 'target': '2013-10-01-03-02-04-comm-central-thunderbird-27.0a1.en-US.win64-x86_64.installer.exe', 'target_url': 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-central/thunderbird-27.0a1.en-US.win64-x86_64.installer.exe' - }, + }, # -p linux --branch=comm-central --extension=txt {'args': {'application': 'thunderbird', @@ -174,7 +174,7 @@ 'extension': 'txt'}, 'target': '2013-10-01-03-02-04-comm-central-thunderbird-27.0a1.en-US.linux-i686.txt', 'target_url': 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-central/thunderbird-27.0a1.en-US.linux-i686.txt' - }, + }, # -p win32 --branch=comm-central -l it {'args': {'application': 'thunderbird', @@ -183,7 +183,7 @@ 'locale': 'it'}, 'target': '2013-10-01-03-02-04-comm-central-thunderbird-27.0a1.it.win32.installer.exe', 'target_url': 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-central-l10n/thunderbird-27.0a1.it.win32.installer.exe' - }, + }, # -p win32 --branch=comm-central -l sv-SE {'args': {'application': 'thunderbird', @@ -192,7 +192,7 @@ 'locale': 'sv-SE'}, 'target': '2013-10-01-03-02-04-comm-central-thunderbird-27.0a1.sv-SE.win32.installer.exe', 'target_url': 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-central-l10n/thunderbird-27.0a1.sv-SE.win32.installer.exe' - }, + }, # -p win32 --branch=comm-central --build-id=20130710110153 {'args': {'application': 'thunderbird', @@ -201,7 +201,7 @@ 'build_id': '20130710110153'}, 'target': '2013-07-10-11-01-53-comm-central-thunderbird-27.0a1.en-US.win32.installer.exe', 'target_url': 'thunderbird/nightly/2013/07/2013-07-10-11-01-53-comm-central/thunderbird-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win32 --branch=comm-central --date=2013-07-10 {'args': {'application': 'thunderbird', @@ -210,7 +210,7 @@ 'date': '2013-07-10'}, 'target': '2013-07-10-11-01-53-comm-central-thunderbird-27.0a1.en-US.win32.installer.exe', 'target_url': 'thunderbird/nightly/2013/07/2013-07-10-11-01-53-comm-central/thunderbird-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win32 --branch=comm-central --date=2013-07-10 --build-number=1 {'args': {'application': 'thunderbird', @@ -220,7 +220,7 @@ 'build_number': 1}, 'target': '2013-07-10-10-01-53-comm-central-thunderbird-27.0a1.en-US.win32.installer.exe', 'target_url': 'thunderbird/nightly/2013/07/2013-07-10-10-01-53-comm-central/thunderbird-27.0a1.en-US.win32.installer.exe' - }, + }, # -p win32 --branch=comm-central {'args': {'application': 'thunderbird', @@ -228,7 +228,7 @@ 'branch': 'comm-aurora'}, 'target': '2013-10-01-03-02-04-comm-aurora-thunderbird-27.0a1.en-US.win32.installer.exe', 'target_url': 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-aurora/thunderbird-27.0a1.en-US.win32.installer.exe' - }, + }, ] tests = firefox_tests + thunderbird_tests @@ -242,12 +242,12 @@ def test_scraper(self): for entry in tests: scraper = DailyScraper(directory=self.temp_dir, base_url=self.wdir, - version=None, **entry['args']) + version=None, 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'])) - + urljoin(self.wdir, entry['target_url'])) if __name__ == '__main__': unittest.main() diff --git a/tests/direct_scraper/test_direct_scraper.py b/tests/direct_scraper/test_direct_scraper.py index 4e864391..a75785b1 100644 --- a/tests/direct_scraper/test_direct_scraper.py +++ b/tests/direct_scraper/test_direct_scraper.py @@ -26,7 +26,8 @@ def test_url_download(self): test_url = 'https://mozqa.com/index.html' scraper = DirectScraper(url=test_url, directory=self.temp_dir, - version=None) + version=None, + log_level='ERROR') self.assertEqual(scraper.url, test_url) self.assertEqual(scraper.final_url, test_url) self.assertEqual(scraper.target, diff --git a/tests/mozhttpd_base_test.py b/tests/mozhttpd_base_test.py index f42f8003..83df67ec 100644 --- a/tests/mozhttpd_base_test.py +++ b/tests/mozhttpd_base_test.py @@ -29,7 +29,7 @@ class MozHttpdBaseTest(unittest.TestCase): def setUp(self): """Starts server that lists all files in the directory""" self.logger = mozlog.getLogger(self.__class__.__name__) - self.logger.setLevel('INFO') + self.logger.setLevel('ERROR') self.httpd = mozhttpd.MozHttpd(port=8080, docroot=HERE, urlhandlers=[{'method': 'GET', 'path': '/api/resources/([^/]+)/?', diff --git a/tests/release_candidate_scraper/test_release_candidate_scraper.py b/tests/release_candidate_scraper/test_release_candidate_scraper.py index b12a1434..26df07db 100644 --- a/tests/release_candidate_scraper/test_release_candidate_scraper.py +++ b/tests/release_candidate_scraper/test_release_candidate_scraper.py @@ -132,6 +132,7 @@ def test_scraper(self): for entry in tests: scraper = ReleaseCandidateScraper(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) diff --git a/tests/release_scraper/test_release_scraper.py b/tests/release_scraper/test_release_scraper.py index 5b4506dd..165783fe 100644 --- a/tests/release_scraper/test_release_scraper.py +++ b/tests/release_scraper/test_release_scraper.py @@ -129,7 +129,7 @@ def test_scraper(self): for entry in tests: scraper = ReleaseScraper(directory=self.temp_dir, base_url=self.wdir, - **entry['args']) + 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), diff --git a/tests/tinderbox_scraper/test_tinderbox_scraper.py b/tests/tinderbox_scraper/test_tinderbox_scraper.py index ab53b25e..0a332d3d 100644 --- a/tests/tinderbox_scraper/test_tinderbox_scraper.py +++ b/tests/tinderbox_scraper/test_tinderbox_scraper.py @@ -226,7 +226,8 @@ def test_scraper(self): for entry in tests: scraper = TinderboxScraper(directory=self.temp_dir, version=None, - base_url=self.wdir, **entry['args']) + 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),