mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user