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

Side by Side Diff: appengine/findit/waterfall/test/swarming_util_test.py

Issue 2488113005: [Findit] Re-org code. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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 | « appengine/findit/waterfall/test/send_notification_for_culprit_pipeline_test.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 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 import collections 5 import collections
6 import json 6 import json
7 import mock 7 import mock
8 import os 8 import os
9 import urllib 9 import urllib
10 import zlib 10 import zlib
11 11
12 from google.appengine.api.urlfetch_errors import DeadlineExceededError 12 from google.appengine.api.urlfetch_errors import DeadlineExceededError
13 from google.appengine.api.urlfetch_errors import DownloadError 13 from google.appengine.api.urlfetch_errors import DownloadError
14 from google.appengine.api.urlfetch_errors import ConnectionClosedError 14 from google.appengine.api.urlfetch_errors import ConnectionClosedError
15 15
16 from common.http_client_appengine import HttpClientAppengine as HttpClient 16 from common.http_client_appengine import HttpClientAppengine as HttpClient
17 from common.retry_http_client import RetryHttpClient 17 from libs.http.retry_http_client import RetryHttpClient
18 from model.wf_config import FinditConfig 18 from model.wf_config import FinditConfig
19 from model.wf_step import WfStep 19 from model.wf_step import WfStep
20 from waterfall import swarming_util 20 from waterfall import swarming_util
21 from waterfall import waterfall_config 21 from waterfall import waterfall_config
22 from waterfall.swarming_task_request import SwarmingTaskRequest 22 from waterfall.swarming_task_request import SwarmingTaskRequest
23 from waterfall.test import wf_testcase 23 from waterfall.test import wf_testcase
24 24
25 25
26 class SwarmingHttpClient(RetryHttpClient): 26 class SwarmingHttpClient(RetryHttpClient):
27 27
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 content, error = swarming_util._SendRequestToServer('url', HttpClient()) 635 content, error = swarming_util._SendRequestToServer('url', HttpClient())
636 self.assertIsNone(content) 636 self.assertIsNone(content)
637 self.assertEqual( 637 self.assertEqual(
638 error['code'], swarming_util.URLFETCH_DEADLINE_EXCEEDED_ERROR) 638 error['code'], swarming_util.URLFETCH_DEADLINE_EXCEEDED_ERROR)
639 639
640 @mock.patch.object(RetryHttpClient, 'Get', side_effect=DownloadError()) 640 @mock.patch.object(RetryHttpClient, 'Get', side_effect=DownloadError())
641 def testSendRequestToServerDownloadError(self, _): 641 def testSendRequestToServerDownloadError(self, _):
642 content, error = swarming_util._SendRequestToServer('url', HttpClient()) 642 content, error = swarming_util._SendRequestToServer('url', HttpClient())
643 self.assertIsNone(content) 643 self.assertIsNone(content)
644 self.assertEqual(error['code'], swarming_util.URLFETCH_DOWNLOAD_ERROR) 644 self.assertEqual(error['code'], swarming_util.URLFETCH_DOWNLOAD_ERROR)
OLDNEW
« no previous file with comments | « appengine/findit/waterfall/test/send_notification_for_culprit_pipeline_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698