tests: Drop os.system calls

Use python native code instead. This seems to avoid an occasional
crash or abort of some sort with latest libosinfo
This commit is contained in:
Cole Robinson 2019-07-17 16:54:59 -04:00
parent ef46af706a
commit 2897951ce1
2 changed files with 3 additions and 3 deletions

View File

@ -1420,8 +1420,8 @@ def cleanup():
Cleanup temporary files used for testing
"""
for i in clean_files:
os.system("chmod 777 %s > /dev/null 2>&1" % i)
os.system("rm -rf %s > /dev/null 2>&1" % i)
if os.path.exists(i):
os.unlink(i)
class CLITests(unittest.TestCase):

View File

@ -35,7 +35,7 @@ class TestClone(unittest.TestCase):
def setUp(self):
for f in local_files:
os.system("touch %s" % f)
open(f, "w").write("")
def tearDown(self):
for f in local_files: