Ejemplo n.º 1
0
def test_reset_stream_not_seekable():
    with pytest.raises(Exception):
        helpers.reset_stream('not_seekable')
Ejemplo n.º 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
Ejemplo n.º 3
0
def test_reset_stream_not_seekable():
    with pytest.raises(Exception):
        helpers.reset_stream('not_seekable')
Ejemplo n.º 4
0
 def reset(self):
     reset_stream(self.__chars)
     self.__extended_rows = self.__iter_extended_rows()
Ejemplo n.º 5
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