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

Unified Diff: unittests/errors_test.py

Issue 2864803003: Minor loader improvements. (Closed)
Patch Set: fix tests Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_engine/unittests/loader_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unittests/errors_test.py
diff --git a/unittests/errors_test.py b/unittests/errors_test.py
index 66dab8bc6f0605ed31723108e17e438c1d7a42f7..15cb5b051e6e19c4f5f47e553e983d6e7423ac58 100755
--- a/unittests/errors_test.py
+++ b/unittests/errors_test.py
@@ -293,6 +293,9 @@ from recipe_engine import step_runner
def bad_print_step(self, step_stream, step, env):
raise Exception("Buh buh buh buh bad to the bone")
+def GenTests(api):
+ pass
+
def RunSteps(api):
step_runner.SubprocessStepRunner._print_step = bad_print_step
try:
@@ -306,6 +309,29 @@ def RunSteps(api):
r'(?s)Recipe engine bug.*Buh buh buh buh bad to the bone'),
retcode=2)
+ def test_missing_method(self):
+ with RecipeRepo() as repo:
+ repo.make_recipe('no_gen_tests', """
+def RunSteps(api):
+ pass
+""")
+ repo.make_recipe('no_run_steps', """
+def GenTests(api):
+ pass
+""")
+
+ self._test_cmd(repo, ['run', 'no_gen_tests'],
+ asserts=lambda stdout, stderr: self.assertRegexpMatches(
+ stdout + stderr,
+ r'(?s)misspelled GenTests'),
+ retcode=2)
+
+ self._test_cmd(repo, ['run', 'no_run_steps'],
+ asserts=lambda stdout, stderr: self.assertRegexpMatches(
+ stdout + stderr,
+ r'(?s)misspelled RunSteps'),
+ retcode=2)
+
def test_unconsumed_assertion(self):
# There was a regression where unconsumed exceptions would not be detected
# if the exception was AssertionError.
« no previous file with comments | « recipe_engine/unittests/loader_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698