tests/readlink.py
author Siddharth Agarwal <sid0@fb.com>
Wed, 13 Aug 2014 22:37:09 -0700
changeset 22157 bd45d92883f9
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
test-alias: add some tests to ensure we aren't double-substituting An earlier iteration of an upcoming patch caused inadvertent double substitution. Ensure we have test coverage for this.

#!/usr/bin/env python

import errno, os, sys

for f in sys.argv[1:]:
    try:
        print f, '->', os.readlink(f)
    except OSError, err:
        if err.errno != errno.EINVAL:
            raise
        print f, 'not a symlink'

sys.exit(0)