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

Side by Side Diff: recipe_modules/bot_update_lite/test_api.py

Issue 1954833002: Add bot_update_lite into recipes (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Also lite Created 4 years, 6 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
« no previous file with comments | « recipe_modules/bot_update_lite/resources/bot_update.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import hashlib 5 import hashlib
6 import os 6 import os
7 import struct 7 import struct
8 import sys 8 import sys
9 from recipe_engine import recipe_test_api 9 from recipe_engine import recipe_test_api
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return self.m.json.output(output) 77 return self.m.json.output(output)
78 78
79 @staticmethod 79 @staticmethod
80 def gen_revision(project, GIT_MODE): 80 def gen_revision(project, GIT_MODE):
81 """Hash project to bogus deterministic revision values.""" 81 """Hash project to bogus deterministic revision values."""
82 h = hashlib.sha1(project) 82 h = hashlib.sha1(project)
83 if GIT_MODE: 83 if GIT_MODE:
84 return h.hexdigest() 84 return h.hexdigest()
85 else: 85 else:
86 return struct.unpack('!I', h.digest()[:4])[0] % 300000 86 return struct.unpack('!I', h.digest()[:4])[0] % 300000
OLDNEW
« no previous file with comments | « recipe_modules/bot_update_lite/resources/bot_update.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698