# HG changeset patch # User Jeff Hammel # Date 1513543069 28800 # Node ID b911a7c01727df0fc48cda8e8fc6398f425920e1 # Parent ff7719f05f0dbbf739de5a26fc036b28963058cb add test common functionality diff -r ff7719f05f0d -r b911a7c01727 tests/common.py --- /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) +