MCPcopy
hub / github.com/psf/requests / test_super_len_tell_ioerror

Method test_super_len_tell_ioerror

tests/test_utils.py:86–96  ·  view source on GitHub ↗

Ensure that if tell gives an IOError super_len doesn't fail

(self, error)

Source from the content-addressed store, hash-verified

84
85 @pytest.mark.parametrize("error", [IOError, OSError])
86 def test_super_len_tell_ioerror(self, error):
87 """Ensure that if tell gives an IOError super_len doesn't fail"""
88
89 class NoLenBoomFile:
90 def tell(self):
91 raise error()
92
93 def seek(self, offset, whence):
94 pass
95
96 assert super_len(NoLenBoomFile()) == 0
97
98 def test_string(self):
99 assert super_len("Test") == 4

Callers

nothing calls this directly

Calls 2

super_lenFunction · 0.90
NoLenBoomFileClass · 0.85

Tested by

no test coverage detected