Mercurial > hg > tvii
changeset 63:b911a7c01727
add test common functionality
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 17 Dec 2017 12:37:49 -0800 |
parents | ff7719f05f0d |
children | 2adeb95cf4d5 |
files | tests/common.py |
diffstat | 1 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/common.py Sun Dec 17 12:37:49 2017 -0800 @@ -0,0 +1,20 @@ +""" +testing common +""" + +import os +from nettwerk import read + +here = os.path.dirname(os.path.abspath(__file__)) +data = os.path.join(here, 'data') + +def datafile(*path): + """returns path within `tests/data`""" + + return os.path.join(data, *path) + +def load(*path, **kwargs): + """load a data file""" + + return read.read(datafile(*path), **kwargs) +