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

Side by Side Diff: recipe_engine/unittests/run_test.py

Issue 2909983003: [loader] Make recipe engine support examples/ module subdir (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « recipe_engine/recipe_api.py ('k') | recipe_modules/context/example.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The LUCI Authors. All rights reserved. 2 # Copyright 2014 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 import json 6 import json
7 import os 7 import os
8 import re 8 import re
9 import subprocess 9 import subprocess
10 import unittest 10 import unittest
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 proc = subprocess.Popen( 48 proc = subprocess.Popen(
49 self._run_cmd(recipe, properties), 49 self._run_cmd(recipe, properties),
50 stdout=subprocess.PIPE, 50 stdout=subprocess.PIPE,
51 stderr=subprocess.STDOUT) 51 stderr=subprocess.STDOUT)
52 stdout = proc.communicate() 52 stdout = proc.communicate()
53 self.assertEqual(0, proc.returncode, '%d != %d when testing %s:\n%s' % ( 53 self.assertEqual(0, proc.returncode, '%d != %d when testing %s:\n%s' % (
54 0, proc.returncode, recipe, stdout)) 54 0, proc.returncode, recipe, stdout))
55 55
56 def test_examples(self): 56 def test_examples(self):
57 tests = [ 57 tests = [
58 ['step:example'], 58 ['step:examples/full'],
59 ['path:example'], 59 ['path:examples/full'],
60 ['raw_io:example'], 60 ['raw_io:examples/full'],
61 ['python:example'], 61 ['python:examples/full'],
62 ['json:example'], 62 ['json:examples/full'],
63 ['uuid:example'], 63 ['uuid:examples/full'],
64 64
65 ['engine_tests/depend_on/top', {'to_pass': 42}], 65 ['engine_tests/depend_on/top', {'to_pass': 42}],
66 ['engine_tests/functools_partial'], 66 ['engine_tests/functools_partial'],
67 ] 67 ]
68 for test in tests: 68 for test in tests:
69 self._test_recipe(*test) 69 self._test_recipe(*test)
70 70
71 def test_bad_subprocess(self): 71 def test_bad_subprocess(self):
72 now = time.time() 72 now = time.time()
73 self._test_recipe('engine_tests/bad_subprocess') 73 self._test_recipe('engine_tests/bad_subprocess')
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 u'foo', 258 u'foo',
259 u'bar', 259 u'bar',
260 u'baz', 260 u'baz',
261 ], 261 ],
262 }) 262 })
263 263
264 264
265 if __name__ == '__main__': 265 if __name__ == '__main__':
266 unittest.TestCase.maxDiff = None 266 unittest.TestCase.maxDiff = None
267 unittest.main() 267 unittest.main()
OLDNEW
« no previous file with comments | « recipe_engine/recipe_api.py ('k') | recipe_modules/context/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698