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

Unified Diff: chrome/common/extensions/docs/server2/servlet.py

Issue 15087006: Docserver: there is only one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: epic rebase Created 7 years, 5 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
Index: chrome/common/extensions/docs/server2/servlet.py
diff --git a/chrome/common/extensions/docs/server2/servlet.py b/chrome/common/extensions/docs/server2/servlet.py
index 35399b4df439ca4c6c53a2b82c0b66ff26909ed1..59ebb5b59152f9390c68bc9d379a1866137cd805 100644
--- a/chrome/common/extensions/docs/server2/servlet.py
+++ b/chrome/common/extensions/docs/server2/servlet.py
@@ -15,8 +15,8 @@ class Request(object):
return Request(path, host, headers or {})
def __repr__(self):
- return 'Request(path=%s, host=%s, headers=%s entries)' % (
- self.path, self.host, len(self.headers.keys()))
+ return 'Request(path=%s, host=%s, headers=%s)' % (
+ self.path, self.host, self.headers)
def __str__(self):
return repr(self)
@@ -105,9 +105,18 @@ class Response(object):
return (None, None)
return (self.headers.get('Location'), self.status == 301)
+ def __eq__(self, other):
+ return (isinstance(other, self.__class__) and
+ str(other.content) == str(self.content) and
+ other.headers == self.headers and
+ other.status == self.status)
+
+ def __ne__(self, other):
+ return not (self == other)
+
def __repr__(self):
- return 'Response(content=%s bytes, status=%s, headers=%s entries)' % (
- len(self.content), self.status, len(self.headers.keys()))
+ return 'Response(content=%s bytes, status=%s, headers=%s)' % (
+ len(self.content), self.status, self.headers)
def __str__(self):
return repr(self)
« no previous file with comments | « chrome/common/extensions/docs/server2/server_instance.py ('k') | chrome/common/extensions/docs/server2/sidenav_data_source.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698