summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <[email protected]>2018-11-16 22:19:26 +0000
committerServer Team CI Bot <[email protected]>2018-11-16 22:19:26 +0000
commitee8a7df52e543b31f8b570e6d1e62bb981a80b34 (patch)
treec075dd350ff576b7f78a03c6eab6d7355143bd38
parent1ef6dfc52f111c2d490b0cf0cba845e3264d0481 (diff)
unittest: change directory to tmpdir for testing relative files.
Previous commit 104331c3318 changed the behavior of the test test_relative_file_url to test with an absolute path, when the point of the test was to test relative. The fix here does what was originally intended, testing that relative file paths work and utilizing the tmp dir.
-rw-r--r--tests/unittests/test_commands_extract.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unittests/test_commands_extract.py b/tests/unittests/test_commands_extract.py
index b7e83056..cc117bbc 100644
--- a/tests/unittests/test_commands_extract.py
+++ b/tests/unittests/test_commands_extract.py
@@ -27,8 +27,9 @@ class TestExtractRootFsImageUrl(CiTestCase):
tmpd = self.tmp_dir()
target = self.tmp_path("target_d", tmpd)
startdir = os.getcwd()
+ fname = "my.img"
try:
- fname = os.path.join(tmpd, "my.img")
+ os.chdir(tmpd)
util.write_file(fname, fname + " data\n")
extract_root_fsimage_url("file://" + fname, target)
finally: