include tornado/test/gettext_translations/fr_FR/LC_MESSAGES/tornado_test.po
include tornado/test/options_test.cfg
include tornado/test/static/robots.txt
+include tornado/test/static/sample.xml
+include tornado/test/static/sample.xml.gz
+include tornado/test/static/sample.xml.bz2
include tornado/test/static/dir/index.html
include tornado/test/static_foo.txt
include tornado/test/templates/utf8.html
"gettext_translations/fr_FR/LC_MESSAGES/tornado_test.po",
"options_test.cfg",
"static/robots.txt",
+ "static/sample.xml",
+ "static/sample.xml.gz",
+ "static/sample.xml.bz2",
"static/dir/index.html",
"static_foo.txt",
"templates/utf8.html",
--- /dev/null
+<?xml version="1.0"?>
+<data>
+ <country name="Liechtenstein">
+ <rank>1</rank>
+ <year>2008</year>
+ <gdppc>141100</gdppc>
+ <neighbor name="Austria" direction="E"/>
+ <neighbor name="Switzerland" direction="W"/>
+ </country>
+ <country name="Singapore">
+ <rank>4</rank>
+ <year>2011</year>
+ <gdppc>59900</gdppc>
+ <neighbor name="Malaysia" direction="N"/>
+ </country>
+ <country name="Panama">
+ <rank>68</rank>
+ <year>2011</year>
+ <gdppc>13600</gdppc>
+ <neighbor name="Costa Rica" direction="W"/>
+ <neighbor name="Colombia" direction="E"/>
+ </country>
+</data>
response = self.fetch('/static/robots.txt')
self.assertTrue(b"Disallow: /" in response.body)
+ self.assertEqual(response.headers.get("Content-Type"), "text/plain")
+
+ def test_static_compressed_files(self):
+ response = self.fetch("/static/sample.xml.gz")
+ self.assertEqual(response.headers.get("Content-Type"),
+ "application/gzip")
+ response = self.fetch("/static/sample.xml.bz2")
+ self.assertEqual(response.headers.get("Content-Type"),
+ "application/octet-stream")
+ # make sure the uncompressed file still has the correct type
+ response = self.fetch("/static/sample.xml")
+ self.assertTrue(response.headers.get("Content-Type")
+ in set(("text/xml", "application/xml")))
def test_static_url(self):
response = self.fetch("/static_url/robots.txt")