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

Side by Side Diff: recipe_modules/file/examples/glob.py

Issue 2973133002: [file] fix glob_paths when NO paths match, add tests. (Closed)
Patch Set: Created 3 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
(Empty)
1 # Copyright 2017 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file.
4
5 DEPS = [
6 "file",
7 "path",
8 "json",
9 ]
10
11 def RunSteps(api):
12 sd = api.path['start_dir']
13
14 for fname in ['thing.pat', 'other.pat', 'something', 'file']:
15 api.file.write_text("write %s" % fname, sd.join(fname), 'data')
16
17 hits = api.file.glob_paths("pat", sd, '*.pat', ['thing.pat', 'other.pat'])
18 assert hits == [sd.join('other.pat'), sd.join('thing.pat')]
19
20 hits = api.file.glob_paths("noop", sd, '*.nop', [])
21 assert hits == []
22
23 hits = api.file.glob_paths("thing", sd, '*thing*', ['thing.pat', 'something'])
24 assert hits == [sd.join('something'), sd.join('thing.pat')]
25
26
27 def GenTests(api):
28 yield api.test('basic')
29
OLDNEW
« no previous file with comments | « recipe_engine/unittests/run_test.py ('k') | recipe_modules/file/examples/glob.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698