tests: Return to kas directory when test_patch finishes
This prevents subseqent tests from starting in the wrong directory. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
b998dfa722
commit
79bfe5a04d
@ -32,8 +32,10 @@ def test_patch(tmpdir):
|
|||||||
tdir = str(tmpdir.mkdir('test_patch'))
|
tdir = str(tmpdir.mkdir('test_patch'))
|
||||||
shutil.rmtree(tdir, ignore_errors=True)
|
shutil.rmtree(tdir, ignore_errors=True)
|
||||||
shutil.copytree('tests/test_patch', tdir)
|
shutil.copytree('tests/test_patch', tdir)
|
||||||
|
prev_dir = os.path.realpath(os.getcwd())
|
||||||
os.chdir(tdir)
|
os.chdir(tdir)
|
||||||
kas.kas(['shell', 'test.yml', '-c', 'true'])
|
kas.kas(['shell', 'test.yml', '-c', 'true'])
|
||||||
for f in ['kas/tests/test_patch/hello.sh', 'hello/hello.sh']:
|
for f in ['kas/tests/test_patch/hello.sh', 'hello/hello.sh']:
|
||||||
assert os.stat(f)[stat.ST_MODE] & stat.S_IXUSR
|
assert os.stat(f)[stat.ST_MODE] & stat.S_IXUSR
|
||||||
kas.kas(['shell', 'test.yml', '-c', 'true'])
|
kas.kas(['shell', 'test.yml', '-c', 'true'])
|
||||||
|
os.chdir(prev_dir)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user