diff options
author | 2015-01-14 11:27:17 +0000 | |
---|---|---|
committer | 2015-01-14 11:55:17 +0000 | |
commit | 1a550ce62bc22ba7436bd8d156b492bffce9edb5 (patch) | |
tree | 4b13ad05fde6032348f68107afedb71d7c5aaec0 /os_net_config | |
parent | 3528e90b0cf8c68e72202c32fada445d39ca13e0 (diff) |
Derive sample location from test file, not pwd
Currently test_cli fails if you don't run it from the repository
top directory, so instead derive a relative path from the test,
which e.g allows you to do nosetests -svx test_cli.py which can
be more convenient when debugging.
Change-Id: I120065ca17104be7c2f4bf00d3e4e281a3179703
Diffstat (limited to 'os_net_config')
-rw-r--r-- | os_net_config/tests/test_cli.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/os_net_config/tests/test_cli.py b/os_net_config/tests/test_cli.py index 908dd7e..6308df8 100644 --- a/os_net_config/tests/test_cli.py +++ b/os_net_config/tests/test_cli.py @@ -22,7 +22,9 @@ from os_net_config.tests import base import six -SAMPLE_BASE = os.path.join('.', 'etc', 'os-net-config', 'samples') +REALPATH = os.path.dirname(os.path.realpath(__file__)) +SAMPLE_BASE = os.path.join(REALPATH, '../../', 'etc', + 'os-net-config', 'samples') class TestCli(base.TestCase): |