]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
fix incorrect pathname
authorBaodong (Robert) Li <baoli@cisco.com>
Fri, 1 Mar 2013 18:02:12 +0000 (10:02 -0800)
committerBaodong (Robert) Li <baoli@cisco.com>
Tue, 5 Mar 2013 21:22:38 +0000 (13:22 -0800)
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

quantum/tests/unit/test_config.py

index 5ae77bdec6b17dc4b4cbe2c07b86ecc32250a2f3..4007f0a4a641422383f4c2cae7116c31809e88a6 100644 (file)
@@ -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)