Skip to content

Commit

Permalink
Added (failing) test test_post_chunked for issue #94.
Browse files Browse the repository at this point in the history
  • Loading branch information
javabrett committed Feb 19, 2018
1 parent 6077c0f commit 69c70dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/base.py
@@ -1,5 +1,6 @@
from meinheld import server
import requests # requests should not be pached
import traceback
from meinheld import patch
patch.patch_all()
import time
Expand Down Expand Up @@ -58,6 +59,8 @@ def _call():
r = self.func()
self.receive_data = r
self.environ = self.app.environ
except:
traceback.print_exc()
finally:
if self.shutdown:
server.shutdown(1)
Expand Down
13 changes: 13 additions & 0 deletions tests/test_wsgi_spec.py
Expand Up @@ -168,6 +168,19 @@ def client():
assert(res.content == ASSERT_RESPONSE)
assert(env.get("wsgi.input").read() == b"key1=value1&key2=value2")

def gen():
yield b"key1=value1&key2=value2"

def test_post_chunked():

def client():
return requests.post("http://localhost:8000/", data=gen())

env, res = run_client(client, App)
assert(res.status_code == 200)
assert(res.content == ASSERT_RESPONSE)
assert(env.get("wsgi.input").read() == b"key1=value1&key2=value2")

def test_upload_file():

def client():
Expand Down

0 comments on commit 69c70dd

Please sign in to comment.