diff options
Diffstat (limited to 'test.py')
-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__": |