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

Unified Diff: recipes/example/module_self_ref.py

Issue 2628523004: Allow module self-reference in loader (Closed)
Patch Set: typo Created 3 years, 11 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/loader.py ('k') | recipes/example/module_self_ref.expected/basic.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes/example/module_self_ref.py
diff --git a/recipes/example/module_self_ref.py b/recipes/example/module_self_ref.py
new file mode 100644
index 0000000000000000000000000000000000000000..be95df2be3559403a636933b3b726c22f0d9085e
--- /dev/null
+++ b/recipes/example/module_self_ref.py
@@ -0,0 +1,23 @@
+# Copyright 2017 The LUCI Authors. All rights reserved.
+# Use of this source code is governed under the Apache License, Version 2.0
+# that can be found in the LICENSE file.
+
+DEPS = [
+ 'step',
+]
+
+
+def RunSteps(api):
+ # This tests that a module self-reference via .m works. Below example looks
+ # rather artificial, but it can be useful in more complex usage, where api
+ # is passed around.
+ #
+ # It's also a regression test for the following error which would otherwise
+ # appear here:
+ #
+ # ModuleInjectionError: Recipe Module 'step' has no dependency 'step'.
+ api.step.m.step('foo', ['true'])
+
+
+def GenTests(api):
+ yield api.test('basic')
« no previous file with comments | « recipe_engine/loader.py ('k') | recipes/example/module_self_ref.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698