def _DoTestRead(file, expected):
    # read in a couple of chunks, just to test that our various arg combinations work.
    got = file.read(3)
    got = got + file.read(300)
    got = got + file.read(0)
    got = got + file.read()
    if got != expected:
        raise RuntimeError, "Reading '%s' failed - got %d bytes, but expected %d bytes" % (file, len(got), len(expected))