Exemplo n.º 1
0
    def test_get_file_content(self):
        request = Request(Environ())
        stream = _io.BytesIO("hello world".encode())
        request.files = {"file": FileStorage(stream=stream, filename="foo")}

        self.assertEqual("hello world",
                         BaseHandler._get_file_content(request).decode())
Exemplo n.º 2
0
    def test_get_file_content_no_file(self):
        request = Request(Environ())
        request.files = {}

        self.assertIsNone(BaseHandler._get_file_content(request))