OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2016 Google Inc. | 3 # Copyright 2016 Google Inc. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 | 8 |
9 """Tests for asset_utils.""" | 9 """Tests for asset_utils.""" |
10 | 10 |
11 | 11 |
12 import asset_utils | 12 import asset_utils |
13 import os | 13 import os |
14 import shutil | 14 import shutil |
15 import subprocess | 15 import subprocess |
16 import sys | 16 import sys |
17 import tempfile | 17 import tempfile |
18 import unittest | 18 import unittest |
19 import uuid | 19 import uuid |
20 | 20 |
21 | 21 |
22 FILE_DIR = os.path.dirname(os.path.abspath(__file__)) | 22 FILE_DIR = os.path.dirname(os.path.abspath(__file__)) |
23 INFRA_BOTS_DIR = os.path.realpath(os.path.join( | 23 INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir)) |
24 FILE_DIR, os.pardir, 'infra', 'bots')) | |
25 sys.path.insert(0, INFRA_BOTS_DIR) | 24 sys.path.insert(0, INFRA_BOTS_DIR) |
26 import test_utils | 25 import test_utils |
27 import utils | 26 import utils |
28 | 27 |
29 | 28 |
30 GS_BUCKET = 'skia-infra-testdata' | 29 GS_BUCKET = 'skia-infra-testdata' |
31 | 30 |
32 | 31 |
33 def _fake_prompt(result): | 32 def _fake_prompt(result): |
34 """Make a function that pretends to prompt for input and returns a result.""" | 33 """Make a function that pretends to prompt for input and returns a result.""" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 114 |
116 self.a.upload_new_version(input_dir) | 115 self.a.upload_new_version(input_dir) |
117 | 116 |
118 self.assertEqual(self.a.get_current_version(), 1) | 117 self.assertEqual(self.a.get_current_version(), 1) |
119 self.assertEqual(self.a.get_available_versions(), [0, 1]) | 118 self.assertEqual(self.a.get_available_versions(), [0, 1]) |
120 self.assertEqual(self.a.get_next_version(), 2) | 119 self.assertEqual(self.a.get_next_version(), 2) |
121 | 120 |
122 | 121 |
123 if __name__ == '__main__': | 122 if __name__ == '__main__': |
124 unittest.main() | 123 unittest.main() |
OLD | NEW |