tests/readlink.py
author pacien <pacien.trangirard@pacien.net>
Tue, 16 May 2023 12:31:07 +0200
changeset 50563 027481f19944
parent 48966 6000f5b25c9b
permissions -rwxr-xr-x
stabletailgraph: add test cases challenging the open merge stack This adds three more complex test cases with situations requiring tricky state update in the stack-based iteration (arriving soon).

#!/usr/bin/env python3


import errno
import os
import 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, '->', f, 'not a symlink')

sys.exit(0)