From: Baodong (Robert) Li Date: Fri, 1 Mar 2013 18:02:12 +0000 (-0800) Subject: fix incorrect pathname X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a4d41a38ccb39a7d218fc46d84e7a9753af067f5;p=openstack-build%2Fneutron-build.git fix incorrect pathname return of call to os.path.abspath('../../..') depends on the setup of nose working directory. Change to return the directory where test_config.py resides fixes: bug #1138216 Change-Id: I1d3f1e3c88bd30871a018a195cee46a91d35c8a8 --- diff --git a/quantum/tests/unit/test_config.py b/quantum/tests/unit/test_config.py index 5ae77bdec..4007f0a4a 100644 --- a/quantum/tests/unit/test_config.py +++ b/quantum/tests/unit/test_config.py @@ -37,8 +37,10 @@ class ConfigurationTest(testtools.TestCase): self.assertTrue(cfg.CONF.allow_bulk) self.assertEqual(5, cfg.CONF.max_dns_nameservers) self.assertEqual(20, cfg.CONF.max_subnet_host_routes) - self.assertEqual(os.path.abspath('../../..'), - cfg.CONF.state_path) + relative_dir = os.path.join(os.path.dirname(__file__), + '..', '..', '..') + absolute_dir = os.path.abspath(relative_dir) + self.assertEqual(absolute_dir, cfg.CONF.state_path) self.assertEqual(120, cfg.CONF.dhcp_lease_duration) self.assertFalse(cfg.CONF.allow_overlapping_ips) self.assertEqual('quantum', cfg.CONF.control_exchange)