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

Side by Side Diff: appengine/findit/model/wf_try_job.py

Issue 2605803002: [Findit] Refactoring WfTryJobData into BaseTryJobData, WfTryJobData, and FlakeTryJobData (Closed)
Patch Set: Fixing code coverage Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 from google.appengine.ext import ndb 5 from google.appengine.ext import ndb
6 6
7 from model.base_build_model import BaseBuildModel 7 from model.base_build_model import BaseBuildModel
8 from model.base_try_job import BaseTryJob 8 from model.base_try_job import BaseTryJob
9 9
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 key=WfTryJob._CreateKey(master_name, builder_name, build_number)) 55 key=WfTryJob._CreateKey(master_name, builder_name, build_number))
56 try_job.compile_results = try_job.compile_results or [] 56 try_job.compile_results = try_job.compile_results or []
57 try_job.test_results = try_job.test_results or [] 57 try_job.test_results = try_job.test_results or []
58 try_job.try_job_ids = try_job.try_job_ids or [] 58 try_job.try_job_ids = try_job.try_job_ids or []
59 return try_job 59 return try_job
60 60
61 @staticmethod 61 @staticmethod
62 def Get(master_name, builder_name, build_number): 62 def Get(master_name, builder_name, build_number):
63 return WfTryJob._CreateKey( 63 return WfTryJob._CreateKey(
64 master_name, builder_name, build_number).get() 64 master_name, builder_name, build_number).get()
65
66 @classmethod
67 def GetBuildNumber(cls, key):
68 return int(key.pairs()[0][1].split('/')[2])
69
70 @ndb.ComputedProperty
71 def build_number(self):
72 return self.GetBuildNumber(self.key)
OLDNEW
« no previous file with comments | « appengine/findit/model/test/wf_try_job_data_test.py ('k') | appengine/findit/model/wf_try_job_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698