MCPcopy
hub / github.com/pallets/werkzeug / test_post_with_file_descriptor

Function test_post_with_file_descriptor

tests/test_test.py:851–860  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

849
850
851def 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
863def test_content_type():

Callers

nothing calls this directly

Calls 4

postMethod · 0.95
ClientClass · 0.90
ResponseClass · 0.90
writeMethod · 0.45

Tested by

no test coverage detected