Skip to content

Commit

Permalink
Add tests to validate wsgi.file_wrapper seek/tell are added
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalresistor committed Jan 17, 2022
1 parent 9db3506 commit a91aca0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_buffers.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ def tearDown(self):
def test_prepare_not_seekable(self):
f = KindaFilelike(b"abc")
inst = self._makeOne(f)
self.assertFalse(hasattr(inst, 'seek'))
self.assertFalse(hasattr(inst, 'tell'))
result = inst.prepare()
self.assertEqual(result, False)
self.assertEqual(inst.remain, 0)
Expand All @@ -200,6 +202,8 @@ def test_prepare_not_seekable_closeable(self):
def test_prepare_seekable_closeable(self):
f = Filelike(b"abc", close=1, tellresults=[0, 10])
inst = self._makeOne(f)
self.assertEqual(inst.seek, f.seek)
self.assertEqual(inst.tell, f.tell)
result = inst.prepare()
self.assertEqual(result, 10)
self.assertEqual(inst.remain, 10)
Expand Down

0 comments on commit a91aca0

Please sign in to comment.