(tmpdir)
| 849 | |
| 850 | |
| 851 | def test_post_with_file_descriptor(tmpdir): |
| 852 | c = Client(Response()) |
| 853 | f = tmpdir.join("some-file.txt") |
| 854 | f.write("foo") |
| 855 | with open(f.strpath) as data: |
| 856 | resp = c.post("/", data=data) |
| 857 | assert resp.status_code == 200 |
| 858 | with open(f.strpath, mode="rb") as data: |
| 859 | resp = c.post("/", data=data) |
| 860 | assert resp.status_code == 200 |
| 861 | |
| 862 | |
| 863 | def test_content_type(): |