diff options
author | Cole Robinson <crobinso@redhat.com> | 2020-08-30 08:54:41 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2020-08-30 14:23:24 -0400 |
commit | 38405a477c0a6c92f18899d07e3cadb3b1999bd5 (patch) | |
tree | c2bee7711bb2dafef7a87e9d180954eaefd5264a /tests/test_cloner.py | |
parent | c36f2323709fe0d81ae981073ff5848fe13027eb (diff) | |
download | virt-manager-38405a477c0a6c92f18899d07e3cadb3b1999bd5.tar.gz |
tests: Add *DIR helper variables
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'tests/test_cloner.py')
-rw-r--r-- | tests/test_cloner.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_cloner.py b/tests/test_cloner.py index f2117ce5..91e19bb5 100644 --- a/tests/test_cloner.py +++ b/tests/test_cloner.py @@ -28,7 +28,7 @@ DISKPOOL = "/dev/disk-pool" local_files = [FILE1, FILE2] -clonexml_dir = os.path.join(os.getcwd(), "tests/data/clone") +CLONEXML_DIR = os.path.join(utils.DATADIR, "clone") class TestClone(unittest.TestCase): @@ -45,7 +45,7 @@ class TestClone(unittest.TestCase): skip_list=None, compare=True, conn=None, clone_disks_file=None): """Helper for comparing clone input/output from 2 xml files""" - infile = os.path.join(clonexml_dir, filebase + "-in.xml") + infile = os.path.join(CLONEXML_DIR, filebase + "-in.xml") in_content = open(infile).read() if not conn: @@ -100,7 +100,7 @@ class TestClone(unittest.TestCase): def _clone_compare(self, cloneobj, outbase, clone_disks_file=None): """Helps compare output from passed clone instance with an xml file""" - outfile = os.path.join(clonexml_dir, outbase + "-out.xml") + outfile = os.path.join(CLONEXML_DIR, outbase + "-out.xml") cloneobj.setup_original() cloneobj.setup_clone() @@ -115,7 +115,7 @@ class TestClone(unittest.TestCase): def _clone_define(self, filebase): """Take the valid output xml and attempt to define it on the connection to ensure we don't get any errors""" - outfile = os.path.join(clonexml_dir, filebase + "-out.xml") + outfile = os.path.join(CLONEXML_DIR, filebase + "-out.xml") outxml = open(outfile).read() conn = utils.URIs.open_testdriver_cached() utils.test_create(conn, outxml) @@ -149,7 +149,7 @@ class TestClone(unittest.TestCase): def testCloneStorageCrossPool(self): conn = utils.URIs.open_test_remote() clone_disks_file = os.path.join( - clonexml_dir, "cross-pool-disks-out.xml") + CLONEXML_DIR, "cross-pool-disks-out.xml") disks = ["%s/new1.img" % POOL2, "%s/new2.img" % POOL1] self._clone("cross-pool", disks=disks, clone_disks_file=clone_disks_file, conn=conn) |