Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: gm/rebaseline_server/download_actuals_test.py

Issue 385783002: roll "common" DEPS, and replace tools/pyutils with it (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix pylint complaints Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 """ 3 """
4 Copyright 2014 Google Inc. 4 Copyright 2014 Google Inc.
5 5
6 Use of this source code is governed by a BSD-style license that can be 6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file. 7 found in the LICENSE file.
8 8
9 Test download.py 9 Test download.py
10 10
11 TODO(epoger): Create a command to update the expected results (in 11 TODO(epoger): Create a command to update the expected results (in
12 self._output_dir_expected) when appropriate. For now, you should: 12 self._output_dir_expected) when appropriate. For now, you should:
13 1. examine the results in self._output_dir_actual and make sure they are ok 13 1. examine the results in self._output_dir_actual and make sure they are ok
14 2. rm -rf self._output_dir_expected 14 2. rm -rf self._output_dir_expected
15 3. mv self._output_dir_actual self._output_dir_expected 15 3. mv self._output_dir_actual self._output_dir_expected
16 Although, if you're using an SVN checkout, this will blow away .svn directories 16 Although, if you're using an SVN checkout, this will blow away .svn directories
17 within self._output_dir_expected, which wouldn't be good... 17 within self._output_dir_expected, which wouldn't be good...
18 18
19 """ 19 """
20 20
21 # System-level imports 21 # System-level imports
22 import os 22 import os
23 import shutil 23
24 import tempfile 24 # Must fix up PYTHONPATH before importing from within Skia
25 import urllib 25 # pylint: disable=W0611
26 import fix_pythonpath
27 # pylint: enable=W0611
borenet 2014/07/11 12:59:11 Same comment.
26 28
27 # Imports from within Skia 29 # Imports from within Skia
28 import fix_pythonpath # must do this first 30 from py.utils import url_utils
29 from pyutils import url_utils
30 import base_unittest 31 import base_unittest
31 import download_actuals 32 import download_actuals
32 33
33 34
34 class DownloadTest(base_unittest.TestCase): 35 class DownloadTest(base_unittest.TestCase):
35 36
36 def test_fetch(self): 37 def test_fetch(self):
37 """Tests fetch() of GM results from actual-results.json .""" 38 """Tests fetch() of GM results from actual-results.json ."""
38 downloader = download_actuals.Download( 39 downloader = download_actuals.Download(
39 actuals_base_url=url_utils.create_filepath_url( 40 actuals_base_url=url_utils.create_filepath_url(
40 os.path.join(self._input_dir, 'gm-actuals')), 41 os.path.join(self._input_dir, 'gm-actuals')),
41 gm_actuals_root_url=url_utils.create_filepath_url( 42 gm_actuals_root_url=url_utils.create_filepath_url(
42 os.path.join(self._input_dir, 'fake-gm-imagefiles'))) 43 os.path.join(self._input_dir, 'fake-gm-imagefiles')))
43 downloader.fetch( 44 downloader.fetch(
44 builder_name='Test-Android-GalaxyNexus-SGX540-Arm7-Release', 45 builder_name='Test-Android-GalaxyNexus-SGX540-Arm7-Release',
45 dest_dir=self._output_dir_actual) 46 dest_dir=self._output_dir_actual)
46 47
47 48
48 def main(): 49 def main():
49 base_unittest.main(DownloadTest) 50 base_unittest.main(DownloadTest)
50 51
51 52
52 if __name__ == '__main__': 53 if __name__ == '__main__':
53 main() 54 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698