diff options
Diffstat (limited to 'test.py')
-rwxr-xr-x | test.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -276,14 +276,15 @@ class StupidIO(object): return self.content[oldpos:self.position] class ContentLengthMiddlewareTest(unittest.TestCase): - def setUp(self): + def customSetUp(self, maxstore=10): self.staticapp = applications.StaticFile(StupidIO(b"success"), "200 Found", [("Content-Type", "text/plain")]) self.app = middlewares.ContentLengthMiddleware(self.staticapp, - maxstore=10) + maxstore=maxstore) self.req = Request(self) def testWithout(self): + self.customSetUp() res = self.req(self.staticapp) res.status("200 Found") try: @@ -293,6 +294,13 @@ class ContentLengthMiddlewareTest(unittest.TestCase): pass def testGet(self): + self.customSetUp() + res = self.req(self.app) + res.status("200 Found") + res.header("Content-length", "7") + + def testInfiniteMaxstore(self): + self.customSetUp(maxstore=()) res = self.req(self.app) res.status("200 Found") res.header("Content-length", "7") |