diff options
author | Helmut Grohne <helmut@subdivi.de> | 2011-06-01 15:13:55 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2011-06-01 15:13:55 +0200 |
commit | bd6eb2127d6c6661c96c3198cd36a4a9c1660089 (patch) | |
tree | b9642294727493faeec6c65796f9df3d54ba136c | |
parent | 8245b1ef9bfbe5b61a3e2c7657ec1377cbbb975e (diff) | |
download | wsgitools-bd6eb2127d6c6661c96c3198cd36a4a9c1660089.tar.gz |
added a test case for applications.StaticFile
-rwxr-xr-x | test.py | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -150,6 +150,24 @@ class StaticContentTest(unittest.TestCase): res.status(200) res.header("Content-length", "7") +class StaticFileTest(unittest.TestCase): + def setUp(self): + self.app = applications.StaticFile(io.StringIO("success"), "200 Found", + [("Content-Type", "text/plain")]) + self.req = Request(self) + + def testGet(self): + res = self.req(self.app) + res.status("200 Found") + res.header("Content-length", "7") + + def testHead(self): + req = self.req.copy() + req.setmethod("HEAD") + res = req(self.app) + res.status(200) + res.header("Content-length", "7") + from wsgitools import digest class AuthDigestMiddlewareTest(unittest.TestCase): @@ -192,6 +210,7 @@ def alltests(case): fullsuite = unittest.TestSuite() fullsuite.addTest(doctest.DocTestSuite("wsgitools.digest")) fullsuite.addTest(alltests(StaticContentTest)) +fullsuite.addTest(alltests(StaticFileTest)) fullsuite.addTest(alltests(AuthDigestMiddlewareTest)) if __name__ == "__main__": |