tests/readlink.py
author Augie Fackler <augie@google.com>
Sun, 28 Feb 2016 22:13:47 -0500
changeset 28319 09222d39fa34
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
pager: add tests We've never had tests for pager, and I want to start experimenting with ways to clean up the implementation and make it a bit more graceful.

#!/usr/bin/env python

import errno, os, sys

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

sys.exit(0)