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

Side by Side Diff: packages/infra_libs/infra_libs/test/instrumented_requests_test.py

Issue 2179853002: Added packages/infra_libs as the first Python package. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Final rebase (no actual changes) Created 4 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
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 datetime 5 import datetime
6 import unittest 6 import unittest
7 7
8 from infra_libs.ts_mon.common import http_metrics 8 from infra_libs.ts_mon.common import http_metrics
9 from infra_libs import instrumented_requests 9 from infra_libs import instrumented_requests
10 from infra_libs import ts_mon 10 from infra_libs import ts_mon
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 def test_wrap_raises_other_exception(self): 133 def test_wrap_raises_other_exception(self):
134 with self.assertRaises(requests.exceptions.RequestException): 134 with self.assertRaises(requests.exceptions.RequestException):
135 self._setup_wrap(side_effect=requests.exceptions.RequestException) 135 self._setup_wrap(side_effect=requests.exceptions.RequestException)
136 136
137 self.assertIsNone(http_metrics.response_status.get( 137 self.assertIsNone(http_metrics.response_status.get(
138 {'name': 'foo', 'client': 'requests', 'status': 200})) 138 {'name': 'foo', 'client': 'requests', 'status': 200}))
139 self.assertEquals(1, http_metrics.response_status.get( 139 self.assertEquals(1, http_metrics.response_status.get(
140 {'name': 'foo', 'client': 'requests', 140 {'name': 'foo', 'client': 'requests',
141 'status': http_metrics.STATUS_EXCEPTION})) 141 'status': http_metrics.STATUS_EXCEPTION}))
OLDNEW
« no previous file with comments | « packages/infra_libs/infra_libs/test/httplib2_utils_test.py ('k') | packages/infra_libs/infra_libs/test/memoize_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698