| OLD | NEW |
| 1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 DEPS = [ | 5 DEPS = [ |
| 6 'path', | 6 'path', |
| 7 'platform', | 7 'platform', |
| 8 'properties', | 8 'properties', |
| 9 'step', | 9 'step', |
| 10 ] | 10 ] |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 assert api.path.exists(file_path) | 48 assert api.path.exists(file_path) |
| 49 | 49 |
| 50 realpath = api.path.realpath(file_path) | 50 realpath = api.path.realpath(file_path) |
| 51 assert api.path.exists(realpath) | 51 assert api.path.exists(realpath) |
| 52 | 52 |
| 53 home_path = api.path.join(api.path.expanduser('~'), 'file') | 53 home_path = api.path.join(api.path.expanduser('~'), 'file') |
| 54 api.step('touch my home', ['touch', home_path]) | 54 api.step('touch my home', ['touch', home_path]) |
| 55 api.path.mock_add_paths(home_path) | 55 api.path.mock_add_paths(home_path) |
| 56 assert api.path.exists(home_path) | 56 assert api.path.exists(home_path) |
| 57 | 57 |
| 58 api.step('volatile tmp_dir', ['echo', api.path.is_volatile('tmp_dir')]) |
| 59 |
| 58 # Convert strings to Paths | 60 # Convert strings to Paths |
| 59 paths_to_convert = [ | 61 paths_to_convert = [ |
| 60 api.path['start_dir'].join('some', 'thing'), | 62 api.path['start_dir'].join('some', 'thing'), |
| 61 api.path['start_dir'], | 63 api.path['start_dir'], |
| 62 api.path.resource("module_resource.py"), | 64 api.path.resource("module_resource.py"), |
| 63 api.path.resource(), | 65 api.path.resource(), |
| 64 api.resource("recipe_resource.py"), | 66 api.resource("recipe_resource.py"), |
| 65 api.resource(), | 67 api.resource(), |
| 66 ] | 68 ] |
| 67 for p in paths_to_convert: | 69 for p in paths_to_convert: |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 yield (api.test('%s_kitchen' % platform) + | 103 yield (api.test('%s_kitchen' % platform) + |
| 102 api.platform.name(platform) + | 104 api.platform.name(platform) + |
| 103 api.properties(path_config='kitchen') + | 105 api.properties(path_config='kitchen') + |
| 104 api.path.exists(api.path['tmp_base'])) | 106 api.path.exists(api.path['tmp_base'])) |
| 105 | 107 |
| 106 yield (api.test('%s_luci' % platform) + | 108 yield (api.test('%s_luci' % platform) + |
| 107 api.platform.name(platform) + | 109 api.platform.name(platform) + |
| 108 api.properties(**{ | 110 api.properties(**{ |
| 109 '$recipe_engine/path': { | 111 '$recipe_engine/path': { |
| 110 'cache_dir': '/c', | 112 'cache_dir': '/c', |
| 111 'tmp_dir': '/t' | 113 'tmp_dir': '/t', |
| 114 'volatile': ['tmp_dir'], |
| 112 }, | 115 }, |
| 113 }) + | 116 }) + |
| 114 api.path.exists(api.path['tmp_base'])) | 117 api.path.exists(api.path['tmp_base'])) |
| OLD | NEW |