Add an extra check that gcert is installed on machine to make sure that the user is googler.

Bug: b/462556449
Change-Id: I2afff69ee202659e23d822c59dd4cc166a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7201883
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Alex Ovsienko <ovsienko@google.com>
This commit is contained in:
Alex Ovsienko
2025-12-01 17:01:18 -08:00
committed by LUCI CQ
parent 4d6030e6b1
commit f32e176f94
2 changed files with 10 additions and 2 deletions

View File

@@ -62,8 +62,10 @@ class BuildTelemetryTest(unittest.TestCase):
# The cached result should be reused.
check_auth.assert_called_once()
def test_enabled(self):
@unittest.mock.patch('shutil.which')
def test_enabled(self, mock_shutil):
test_countdown = 2
mock_shutil.return_value = "path"
# Googler auto opt-in.
with tempfile.TemporaryDirectory() as tmpdir:
@@ -138,6 +140,7 @@ class BuildTelemetryTest(unittest.TestCase):
# Non-Googler
with tempfile.TemporaryDirectory() as tmpdir:
mock_shutil.return_value = None
cfg_path = os.path.join(tmpdir, "build_telemetry.cfg")
with unittest.mock.patch(
'build_telemetry.check_auth') as check_auth: