Tests: pathlib used where appropriate

Also fixed various pylint errors and style issues.
This commit is contained in:
Andrei Zeliankou
2024-01-15 15:48:58 +00:00
parent e95a91cbfa
commit 5a8337933d
72 changed files with 306 additions and 256 deletions

View File

@@ -1,4 +1,4 @@
import os
from pathlib import Path
import shutil
from urllib.parse import quote
@@ -26,10 +26,9 @@ class ApplicationPython(ApplicationProto):
if kwargs.get('isolation') and kwargs['isolation'].get('rootfs'):
rootfs = kwargs['isolation']['rootfs']
if not os.path.exists(f'{rootfs}/app/python/'):
os.makedirs(f'{rootfs}/app/python/')
Path(f'{rootfs}/app/python/').mkdir(parents=True, exist_ok=True)
if not os.path.exists(f'{rootfs}/app/python/{name}'):
if not Path(f'{rootfs}/app/python/{name}').exists():
shutil.copytree(script_path, f'{rootfs}/app/python/{name}')
script_path = f'/app/python/{name}'