Enhanced HttpError to now include the original request URI if possible.
diff --git a/tests/test_errors.py b/tests/test_errors.py
index 44b2a14..ab0be28 100644
--- a/tests/test_errors.py
+++ b/tests/test_errors.py
@@ -27,42 +27,7 @@
 from apiclient.errors import HttpError
 
 
-def fake_response(data, headers):
-  return httplib2.Response(headers), data
-
-
-class Error(unittest.TestCase):
-  """Test handling of error bodies."""
-
-  def test_json_body(self):
-    """Test a nicely formed, expected error response."""
-    resp, content = fake_response(json_error_content,
-        {'status':'400', 'content-type': 'application/json'})
-    error = HttpError(resp, content)
-    self.assertEqual(str(error), '<HttpError 400 "country is required">')
-
-  def test_bad_json_body(self):
-    """Test handling of bodies with invalid json."""
-    resp, content = fake_response('{',
-        {'status':'400', 'content-type': 'application/json'})
-    error = HttpError(resp, content)
-    self.assertEqual(str(error), '<HttpError 400 "{">')
-
-  def test_missing_message_json_body(self):
-    """Test handling of bodies with missing expected 'message' element."""
-    resp, content = fake_response('{}',
-        {'status':'400', 'content-type': 'application/json'})
-    error = HttpError(resp, content)
-    self.assertEqual(str(error), '<HttpError 400 "{}">')
-    
-  def test_non_json(self):
-    """Test handling of non-JSON bodies"""
-    resp, content = fake_response('NOT OK', {'status':'400'})
-    error = HttpError(resp, content)
-    self.assertEqual(str(error), '<HttpError 400 "Ok">')
-
-
-json_error_content = """
+JSON_ERROR_CONTENT = """
 {
  "error": {
   "errors": [
@@ -80,3 +45,43 @@
 }
 """
 
+def fake_response(data, headers):
+  return httplib2.Response(headers), data
+
+
+class Error(unittest.TestCase):
+  """Test handling of error bodies."""
+
+  def test_json_body(self):
+    """Test a nicely formed, expected error response."""
+    resp, content = fake_response(JSON_ERROR_CONTENT,
+        {'status':'400', 'content-type': 'application/json'})
+    error = HttpError(resp, content)
+    self.assertEqual(str(error), '<HttpError 400 "country is required">')
+
+  def test_bad_json_body(self):
+    """Test handling of bodies with invalid json."""
+    resp, content = fake_response('{',
+        {'status':'400', 'content-type': 'application/json'})
+    error = HttpError(resp, content)
+    self.assertEqual(str(error), '<HttpError 400 "{">')
+
+  def test_with_uri(self):
+    """Test handling of passing in the request uri."""
+    resp, content = fake_response('{',
+        {'status':'400', 'content-type': 'application/json'})
+    error = HttpError(resp, content, 'http://example.org')
+    self.assertEqual(str(error), '<HttpError 400 when requesting http://example.org returned "{">')
+
+  def test_missing_message_json_body(self):
+    """Test handling of bodies with missing expected 'message' element."""
+    resp, content = fake_response('{}',
+        {'status':'400', 'content-type': 'application/json'})
+    error = HttpError(resp, content)
+    self.assertEqual(str(error), '<HttpError 400 "{}">')
+
+  def test_non_json(self):
+    """Test handling of non-JSON bodies"""
+    resp, content = fake_response('NOT OK', {'status':'400'})
+    error = HttpError(resp, content)
+    self.assertEqual(str(error), '<HttpError 400 "Ok">')