[auth] Add test for overwriting global SSO rewrite rules

Sanity check for attached bug

Bug: b/390219533
Change-Id: I788e6beaa7f838568714b98b6f7923d455e6e3a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6178580
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
changes/80/6178580/3
Allen Li 6 months ago committed by LUCI CQ
parent 877b1e3cbd
commit 8eff9d233f

@ -178,6 +178,24 @@ class TestConfigChanger(unittest.TestCase):
}
self.assertEqual(self.global_state, want)
def test_apply_global_chain_sso_new(self):
git_auth.ConfigChanger(
mode=git_auth.ConfigMode.NEW_AUTH_SSO,
remote_url=
'https://chromium.googlesource.com/chromium/tools/depot_tools.git',
).apply_global('/some/fake/dir')
git_auth.ConfigChanger(
mode=git_auth.ConfigMode.NEW_AUTH,
remote_url=
'https://chromium.googlesource.com/chromium/tools/depot_tools.git',
).apply_global('/some/fake/dir')
want = {
'protocol.sso.allow': ['always'],
'credential.https://chromium.googlesource.com/.helper':
['', 'luci'],
}
self.assertEqual(self.global_state, want)
if __name__ == '__main__':
logging.basicConfig(

Loading…
Cancel
Save