summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test.py b/test.py
index c9bab38..4247d88 100755
--- a/test.py
+++ b/test.py
@@ -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__":