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

Unified Diff: scripts/slave/recipe_modules/service_account/example.py

Issue 1954753003: Service account module (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Sorting deps. Created 4 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
Index: scripts/slave/recipe_modules/service_account/example.py
diff --git a/scripts/slave/recipe_modules/service_account/example.py b/scripts/slave/recipe_modules/service_account/example.py
new file mode 100644
index 0000000000000000000000000000000000000000..3785e44b61b9ff3ab784cec5fd0958fee5f02197
--- /dev/null
+++ b/scripts/slave/recipe_modules/service_account/example.py
@@ -0,0 +1,29 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+DEPS = [
+ 'recipe_engine/platform',
+ 'recipe_engine/raw_io',
+ 'service_account',
+]
+
+"""Small example of using the service_account api."""
+
+def RunSteps(api):
+ _ = api.service_account.get_token('fake-account')
+
+
+def GenTests(api):
+ yield (api.test('service_account_win') +
+ api.step_data('get access token',
+ stdout=api.raw_io.output('MockTokenValueThing')) +
+ api.platform('win', 32))
+ yield (api.test('service_account_linux') +
+ api.step_data('get access token',
+ stdout=api.raw_io.output('MockTokenValueThing')) +
+ api.platform('linux', 64))
+ yield (api.test('service_account_no_authutil') +
+ api.step_data('get access token',
+ retcode=1) +
+ api.platform('linux', 64))

Powered by Google App Engine
This is Rietveld 408576698