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

Unified Diff: recipe_modules/context/test_api.py

Issue 2985323002: Add support for LUCI_CONTEXT.
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 side-by-side diff with in-line comments
Download patch
Index: recipe_modules/context/test_api.py
diff --git a/recipe_modules/context/test_api.py b/recipe_modules/context/test_api.py
new file mode 100644
index 0000000000000000000000000000000000000000..81ce74bd798e65c57fbe6548fadebdd3cefe04a9
--- /dev/null
+++ b/recipe_modules/context/test_api.py
@@ -0,0 +1,15 @@
+# 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.
+
+from recipe_engine import recipe_test_api
+
+class ContextTestApi(recipe_test_api.RecipeTestApi):
+ @recipe_test_api.mod_test_data
+ @staticmethod
+ def luci_context(ctx):
+ """Completely mocks LUCI_CONTEXT values."""
iannucci 2017/08/04 18:55:51 I would say something like "Sets the initial LUCI_
+ # TODO: more validation
+ if not isinstance(ctx, dict): # pragma: no cover
+ raise TypeError('Expecting a dict')
+ return ctx

Powered by Google App Engine
This is Rietveld 408576698