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

Side by Side Diff: appengine/components/components/auth_testing.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Fixed third parties 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The LUCI Authors. All rights reserved. 1 # Copyright 2014 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed by the Apache v2.0 license that can be 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Helpers for mocking auth stuff in unit tests. 5 """Helpers for mocking auth stuff in unit tests.
6 6
7 Must not be used from main application code, only from unit tests. 7 Must not be used from main application code, only from unit tests.
8 """ 8 """
9 9
10 from components import utils 10 from components import utils
11 11
12 from components.auth import api 12 from components.auth import api
13 from components.auth import handler 13 from components.auth import handler
(...skipping 26 matching lines...) Expand all
40 orig = api.is_group_member 40 orig = api.is_group_member
41 def mocked_is_group_member(group, ident): 41 def mocked_is_group_member(group, ident):
42 if group == model.ADMIN_GROUP: 42 if group == model.ADMIN_GROUP:
43 return value 43 return value
44 return orig(group, ident) 44 return orig(group, ident)
45 test_case.mock(api, 'is_group_member', mocked_is_group_member) 45 test_case.mock(api, 'is_group_member', mocked_is_group_member)
46 46
47 47
48 # reset_local_state must be called only in tests, so expose it here. 48 # reset_local_state must be called only in tests, so expose it here.
49 reset_local_state = api.reset_local_state 49 reset_local_state = api.reset_local_state
OLDNEW
« no previous file with comments | « appengine/components/components/auth/version.py ('k') | appengine/components/components/config/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698