def METHOD_NAME(class_, args, request, tmpdir_factory):
    stream = class_(*[(arg if arg is not make_tmpfile
                      else arg(request, tmpdir_factory))
                      for arg in args])
    if not stream.can_write():
        return
    assert stream.size() == 0
    assert stream.tell() == 0
    stream.truncate(100)
    assert stream.size() == 100
    assert stream.tell() == 0
    stream.seek(99)
    assert stream.tell() == 99
    stream.truncate(50)
    assert stream.tell() == 50
    assert stream.size() == 50
    stream.write_string('hello')
    stream.flush()
    assert stream.tell() == 50 + 9
    assert stream.size() == 50 + 9