diff options
| author | Clark Boylan <clark.boylan@gmail.com> | 2012-11-30 13:28:57 -0800 |
|---|---|---|
| committer | Clark Boylan <clark.boylan@gmail.com> | 2012-11-30 13:43:49 -0800 |
| commit | b178e44f49f2b7ab6b7ded132dade582011c9f8a (patch) | |
| tree | 821a84b43f18e42c7dbc5d3732ecd25eb1a04692 | |
| parent | c658a6f73bc27f6c62cd87815bd335214b8cf719 (diff) | |
| download | nova-b178e44f49f2b7ab6b7ded132dade582011c9f8a.tar.gz nova-b178e44f49f2b7ab6b7ded132dade582011c9f8a.tar.xz nova-b178e44f49f2b7ab6b7ded132dade582011c9f8a.zip | |
Open test xenapi/vm_rrd.xml relative to tests.
The test xenapi/vm_rrd.xml file was opened in test_xenapi.py relative to
the current working directory. This forced you to run unittests out of
the nova/tests directory. Open the xenapi/vm_rrd.xml relative to the
test_xenapi.py file so that the current working directory does not
matter.
Part of blueprint grizzly-testtools
Change-Id: I2b8720ea418e10e9748adaa599513794202351e6
| -rw-r--r-- | nova/tests/test_xenapi.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index c23e42570..6d0686258 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -345,7 +345,8 @@ class XenAPIVMTestCase(stubs.XenAPITestBase): def test_get_diagnostics(self): def fake_get_rrd(host, vm_uuid): - with open('xenapi/vm_rrd.xml') as f: + path = os.path.dirname(os.path.realpath(__file__)) + with open(os.path.join(path, 'xenapi/vm_rrd.xml')) as f: return re.sub(r'\s', '', f.read()) self.stubs.Set(vm_utils, '_get_rrd', fake_get_rrd) |
