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

Unified Diff: tests/rietveld_test.py

Issue 1686753003: Revert "Raise exceptions properly on HTTP errors from OAuthRpcServer (which is only used on bots)" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « rietveld.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/rietveld_test.py
diff --git a/tests/rietveld_test.py b/tests/rietveld_test.py
index 36d114e5092bb0db9c5c1526149ad5a77412dca1..7bcb9bcbcadc946c3b06660efa67ddb6260c836f 100755
--- a/tests/rietveld_test.py
+++ b/tests/rietveld_test.py
@@ -5,23 +5,19 @@
"""Unit tests for rietveld.py."""
-import httplib
import logging
import os
import socket
import ssl
-import StringIO
import sys
import time
import traceback
import unittest
-import urllib2
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from testing_support.patches_data import GIT, RAW
from testing_support import auto_stub
-from third_party import httplib2
import patch
import rietveld
@@ -494,30 +490,6 @@ class DefaultTimeoutTest(auto_stub.TestCase):
self.rietveld.post('/api/1234', [('key', 'data')])
self.assertNotEqual(self.sleep_time, 0)
-
-class OAuthRpcServerTest(auto_stub.TestCase):
- def setUp(self):
- super(OAuthRpcServerTest, self).setUp()
- self.rpc_server = rietveld.OAuthRpcServer(
- 'http://www.example.com', 'foo', 'bar')
-
- def set_mock_response(self, status):
- def MockHttpRequest(*args, **kwargs):
- return (httplib2.Response({'status': status}), 'body')
- self.mock(self.rpc_server._http, 'request', MockHttpRequest)
-
- def test_404(self):
- self.set_mock_response(404)
- with self.assertRaises(urllib2.HTTPError) as ctx:
- self.rpc_server.Send('/foo')
- self.assertEquals(404, ctx.exception.code)
-
- def test_200(self):
- self.set_mock_response(200)
- ret = self.rpc_server.Send('/foo')
- self.assertEquals('body', ret)
-
-
if __name__ == '__main__':
logging.basicConfig(level=[
logging.ERROR, logging.INFO, logging.DEBUG][min(2, sys.argv.count('-v'))])
« no previous file with comments | « rietveld.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698