def test_get_text_file(self): backend = _test_backend([], named_files={'description': 'foo'}) mat = re.search('.*', 'description') output = ''.join(get_text_file(self._req, backend, mat)) self.assertEquals('foo', output) self.assertEquals(HTTP_OK, self._status) self.assertContentTypeEquals('text/plain') self.assertFalse(self._req.cached)
def test_get_text_file(self): backend = _test_backend([], named_files={"description": b"foo"}) mat = re.search(".*", "description") output = b"".join(get_text_file(self._req, backend, mat)) self.assertEqual(b"foo", output) self.assertEqual(HTTP_OK, self._status) self.assertContentTypeEquals("text/plain") self.assertFalse(self._req.cached)
def test_get_text_file(self): backend = _test_backend([], named_files={"description": "foo"}) mat = re.search(".*", "description") output = "".join(get_text_file(self._req, backend, mat)) self.assertEquals("foo", output) self.assertEquals(HTTP_OK, self._status) self.assertContentTypeEquals("text/plain") self.assertFalse(self._req.cached)