Chromium Code Reviews

Side by Side Diff: third_party/httplib2/test/test_no_socket.py

Issue 183793010: Added OAuth2 authentication to apply_issue (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Added another option Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(Empty)
1 """Tests for httplib2 when the socket module is missing.
2
3 This helps ensure compatibility with environments such as AppEngine.
4 """
5 import os
6 import sys
7 import unittest
8
9 import httplib2
10
11 class MissingSocketTest(unittest.TestCase):
12 def setUp(self):
13 self._oldsocks = httplib2.socks
14 httplib2.socks = None
15
16 def tearDown(self):
17 httplib2.socks = self._oldsocks
18
19 def testProxyDisabled(self):
20 proxy_info = httplib2.ProxyInfo('blah',
21 'localhost', 0)
22 client = httplib2.Http(proxy_info=proxy_info)
23 self.assertRaises(httplib2.ProxiesUnavailableError,
24 client.request, 'http://localhost:-1/')
OLDNEW

Powered by Google App Engine