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

Side by Side Diff: appengine/findit/handlers/crash/test/triage_fracas_analysis_test.py

Issue 2663063007: [Predator] Switch from anonymous dict to CrashData. (Closed)
Patch Set: Rebase and fix delta test. Created 3 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 import calendar 4 import calendar
5 import base64 5 import base64
6 import copy 6 import copy
7 from datetime import datetime 7 from datetime import datetime
8 from datetime import time 8 from datetime import time
9 from datetime import timedelta 9 from datetime import timedelta
10 import json 10 import json
(...skipping 18 matching lines...) Expand all
29 triage_fracas_analysis.TriageFracasAnalysis)], debug=True) 29 triage_fracas_analysis.TriageFracasAnalysis)], debug=True)
30 30
31 def setUp(self): 31 def setUp(self):
32 super(TriageFracasAnalysisTest, self).setUp() 32 super(TriageFracasAnalysisTest, self).setUp()
33 analysis = FracasCrashAnalysis.Create({'signature': 'signature'}) 33 analysis = FracasCrashAnalysis.Create({'signature': 'signature'})
34 analysis.signature = 'signature' 34 analysis.signature = 'signature'
35 analysis.crashed_version = '53.0.2750.0' 35 analysis.crashed_version = '53.0.2750.0'
36 analysis.stack_trace = 'dummy\nframe1\nframe2' 36 analysis.stack_trace = 'dummy\nframe1\nframe2'
37 analysis.platform = 'android' 37 analysis.platform = 'android'
38 analysis.channel = 'canary' 38 analysis.channel = 'canary'
39 analysis.client_id = 'fracas'
40 analysis.status = analysis_status.COMPLETED 39 analysis.status = analysis_status.COMPLETED
41 analysis.historical_metadata = [ 40 analysis.historical_metadata = [
42 {'chrome_version': '53.0.2748.0', 'cpm': 0}, 41 {'chrome_version': '53.0.2748.0', 'cpm': 0},
43 {'chrome_version': '53.0.2749.0', 'cpm': 0}, 42 {'chrome_version': '53.0.2749.0', 'cpm': 0},
44 {'chrome_version': '53.0.2750.0', 'cpm': 0.8} 43 {'chrome_version': '53.0.2750.0', 'cpm': 0.8}
45 ] 44 ]
46 45
47 suspected_cl = { 46 suspected_cl = {
48 'url': 'https://chromium.googlesource.com/chromium/src/+/346a', 47 'url': 'https://chromium.googlesource.com/chromium/src/+/346a',
49 'review_url': 'https://review', 48 'review_url': 'https://review',
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 analysis = self.key.get() 96 analysis = self.key.get()
98 for key, value in update.iteritems(): 97 for key, value in update.iteritems():
99 self.assertEqual(getattr(analysis, key), value) 98 self.assertEqual(getattr(analysis, key), value)
100 99
101 def testUpdateNote(self): 100 def testUpdateNote(self):
102 update = {'note': 'this is a note. +2314>?'} 101 update = {'note': 'this is a note. +2314>?'}
103 self.test_app.post('/triage-fracas-analysis?key=%s' % self.key.urlsafe(), 102 self.test_app.post('/triage-fracas-analysis?key=%s' % self.key.urlsafe(),
104 {'update-data': json.dumps(update)}) 103 {'update-data': json.dumps(update)})
105 analysis = self.key.get() 104 analysis = self.key.get()
106 self.assertEqual(analysis.note, update['note']) 105 self.assertEqual(analysis.note, update['note'])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698