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

Side by Side Diff: infra_libs/test/httplib2_utils_test.py

Issue 1260293009: make version of ts_mon compatible with appengine (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: add noncululativedistribution metric to ts_mon imports Created 5 years, 4 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 | « infra_libs/logs/logs.py ('k') | infra_libs/test/instrumented_requests_test.py » ('j') | 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 os 5 import os
6 import unittest 6 import unittest
7 7
8 from infra_libs import http_metrics 8 from infra_libs.ts_mon.common import http_metrics
9 from infra_libs import httplib2_utils 9 from infra_libs import httplib2_utils
10 10
11 import httplib2 11 import httplib2
12 import mock 12 import mock
13 import oauth2client.client 13 import oauth2client.client
14 14
15 15
16 DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data') 16 DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
17 17
18 18
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 self.http._request.return_value = ( 193 self.http._request.return_value = (
194 httplib2.Response({'status': 200}), 194 httplib2.Response({'status': 200}),
195 'content') 195 'content')
196 196
197 _, _ = self.http.request('http://foo/') 197 _, _ = self.http.request('http://foo/')
198 self.assertEqual(1, http_metrics.durations.get( 198 self.assertEqual(1, http_metrics.durations.get(
199 {'name': 'test', 'client': 'httplib2'}).count) 199 {'name': 'test', 'client': 'httplib2'}).count)
200 self.assertAlmostEqual(300, http_metrics.durations.get( 200 self.assertAlmostEqual(300, http_metrics.durations.get(
201 {'name': 'test', 'client': 'httplib2'}).sum) 201 {'name': 'test', 'client': 'httplib2'}).sum)
OLDNEW
« no previous file with comments | « infra_libs/logs/logs.py ('k') | infra_libs/test/instrumented_requests_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698