From 1a550ce62bc22ba7436bd8d156b492bffce9edb5 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Wed, 14 Jan 2015 11:27:17 +0000 Subject: 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 --- os_net_config/tests/test_cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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): -- cgit 1.2.3-korg