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

Unified Diff: third_party/twisted_8_1/twisted/web/test/test_static.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 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
Index: third_party/twisted_8_1/twisted/web/test/test_static.py
diff --git a/third_party/twisted_8_1/twisted/web/test/test_static.py b/third_party/twisted_8_1/twisted/web/test/test_static.py
deleted file mode 100644
index eb0463a5466cbaaa5e271dfdf43205d2519b8c14..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/web/test/test_static.py
+++ /dev/null
@@ -1,64 +0,0 @@
-from twisted.trial import unittest
-import os
-from twisted.web import static
-
-class FakeRequest:
- method = 'GET'
-
- _headers = None
- _setHeaders = None
- _written = ''
-
- def __init__(self):
- self._headers = {}
- self._setHeaders = {}
-
- def getHeader(self, k):
- if self._headers is None:
- return None
- return self._headers.get(k)
-
- def setHeader(self, k, v):
- self._setHeaders.setdefault(k, []).append(v)
-
- def setLastModified(self, x):
- pass
- def registerProducer(self, producer, x):
- producer.resumeProducing()
- def unregisterProducer(self):
- pass
- def finish(self):
- pass
-
- def write(self, data):
- self._written = self._written + data
-
-class Range(unittest.TestCase):
- todo = (unittest.FailTest, 'No range support yet.')
-
- def setUp(self):
- self.tmpdir = self.mktemp()
- os.mkdir(self.tmpdir)
- name = os.path.join(self.tmpdir, 'junk')
- f = file(name, 'w')
- f.write(8000 * 'x')
- f.close()
- self.file = static.File(name)
- self.request = FakeRequest()
-
- def testBodyLength(self):
- self.request._headers['range'] = 'bytes=0-1999'
- self.file.render(self.request)
- self.assertEquals(len(self.request._written), 2000)
-
- def testContentLength(self):
- """Content-Length of a request is correct."""
- self.request._headers['range'] = 'bytes=0-1999'
- self.file.render(self.request)
- self.assertEquals(self.request._setHeaders['content-length'], ['2000'])
-
- def testContentRange(self):
- """Content-Range of a request is correct."""
- self.request._headers['range'] = 'bytes=0-1999'
- self.file.render(self.request)
- self.assertEquals(self.request._setHeaders.get('content-range'), ['bytes 0-1999/8000'])
« no previous file with comments | « third_party/twisted_8_1/twisted/web/test/test_soap.py ('k') | third_party/twisted_8_1/twisted/web/test/test_tap.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698