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

Side by Side Diff: appengine/findit/gae_libs/testcase.py

Issue 2673733002: [Predator] Add CrashData class to process raw json crash data. (Closed)
Patch Set: Rebase and fix nits. 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 4
5 import os 5 import os
6 6
7 from testing_utils import testing 7 from testing_utils import testing
8 8
9 from gae_libs.http.http_client_appengine import HttpClientAppengine 9 from gae_libs.http.http_client_appengine import HttpClientAppengine
10 from libs import time_util 10 from libs import time_util
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 def MockUTCNow(self, mocked_utcnow): 68 def MockUTCNow(self, mocked_utcnow):
69 """Mocks utcnow with the given value for testing.""" 69 """Mocks utcnow with the given value for testing."""
70 self.mock(time_util, 'GetUTCNow', lambda: mocked_utcnow) 70 self.mock(time_util, 'GetUTCNow', lambda: mocked_utcnow)
71 71
72 def MockUTCNowWithTimezone(self, mocked_utcnow): 72 def MockUTCNowWithTimezone(self, mocked_utcnow):
73 """Mocks utcnow with the given value for testing.""" 73 """Mocks utcnow with the given value for testing."""
74 self.mock(time_util, 'GetUTCNowWithTimezone', lambda: mocked_utcnow) 74 self.mock(time_util, 'GetUTCNowWithTimezone', lambda: mocked_utcnow)
75 75
76 def GetMockHttpClient(self, response_for_url=None): 76 def GetMockHttpClient(self, response_for_url=None):
77 """Returns mocked http client class.""" 77 """Returns mocked http client class."""
78 return MockHttpClient(response_for_url) 78 return MockHttpClient(response_for_url or {})
79
80 def GetMockRepoFactory(self, response_for_url=None):
81 """Returns mocked repository factory."""
82 return GitilesRepository.Factory(
83 self.GetMockHttpClient(response_for_url or {}))
OLDNEW
« no previous file with comments | « appengine/findit/crash/test/predator_testcase.py ('k') | appengine/findit/handlers/crash/test/crash_handler_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698