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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 api.path['start_dir'].join('some', 'thing'), | 60 api.path['start_dir'].join('some', 'thing'), |
61 api.path['start_dir'], | 61 api.path['start_dir'], |
62 api.path.resource("module_resource.py"), | 62 api.path.resource("module_resource.py"), |
63 api.path.resource(), | 63 api.path.resource(), |
64 api.resource("recipe_resource.py"), | 64 api.resource("recipe_resource.py"), |
65 api.resource(), | 65 api.resource(), |
66 ] | 66 ] |
67 for p in paths_to_convert: | 67 for p in paths_to_convert: |
68 after = api.path.abs_to_path(str(p)) | 68 after = api.path.abs_to_path(str(p)) |
69 api.step('converted path %s' % p, ['echo', after]) | 69 api.step('converted path %s' % p, ['echo', after]) |
70 assert after == p, p | 70 assert after == p, (after, p) |
71 | 71 |
72 try: | 72 try: |
73 api.path.abs_to_path('non/../absolute') | 73 api.path.abs_to_path('non/../absolute') |
74 assert False, "this should have thrown" # pragma: no cover | 74 assert False, "this should have thrown" # pragma: no cover |
75 except ValueError as ex: | 75 except ValueError as ex: |
76 assert "is not absolute" in ex.message, ex | 76 assert "is not absolute" in ex.message, ex |
77 | 77 |
78 try: | 78 try: |
79 if api.platform.is_win: | 79 if api.platform.is_win: |
80 api.path.abs_to_path('C:\some\other\root\non\absolute') | 80 api.path.abs_to_path('C:\some\other\root\non\absolute') |
(...skipping 24 matching lines...) Expand all Loading... |
105 | 105 |
106 yield (api.test('%s_luci' % platform) + | 106 yield (api.test('%s_luci' % platform) + |
107 api.platform.name(platform) + | 107 api.platform.name(platform) + |
108 api.properties(**{ | 108 api.properties(**{ |
109 '$recipe_engine/path': { | 109 '$recipe_engine/path': { |
110 'cache_dir': '/c', | 110 'cache_dir': '/c', |
111 'tmp_dir': '/t' | 111 'tmp_dir': '/t' |
112 }, | 112 }, |
113 }) + | 113 }) + |
114 api.path.exists(api.path['tmp_base'])) | 114 api.path.exists(api.path['tmp_base'])) |
OLD | NEW |