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

Function test_file_closing

tests/test_test.py:425–440  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

423
424
425def test_file_closing():
426 closed = []
427
428 class SpecialInput:
429 def read(self, size):
430 return b""
431
432 def close(self):
433 closed.append(self)
434
435 create_environ(data={"foo": SpecialInput()})
436 assert len(closed) == 1
437 builder = EnvironBuilder()
438 builder.files.add_file("blah", SpecialInput())
439 builder.close()
440 assert len(closed) == 2
441
442
443def test_follow_redirect():

Callers

nothing calls this directly

Calls 5

closeMethod · 0.95
create_environFunction · 0.90
EnvironBuilderClass · 0.90
SpecialInputClass · 0.85
add_fileMethod · 0.80

Tested by

no test coverage detected