Example #1
0
def test_reset_stream_not_seekable():
    with pytest.raises(Exception):
        helpers.reset_stream('not_seekable')
Example #2
0
def test_reset_stream_seekable():
    file = io.open(__file__)
    file.seek(1)
    assert file.tell() == 1
    helpers.reset_stream(file)
    assert file.tell() == 0
def test_reset_stream_not_seekable():
    with pytest.raises(Exception):
        helpers.reset_stream('not_seekable')
Example #4
0
 def reset(self):
     reset_stream(self.__chars)
     self.__extended_rows = self.__iter_extended_rows()
def test_reset_stream_seekable():
    file = io.open(__file__)
    file.seek(1)
    assert file.tell() == 1
    helpers.reset_stream(file)
    assert file.tell() == 0