mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix PyTest's tests integration files copy
This commit is contained in:
parent
f9e1a115e5
commit
0a8bedd2ae
1 changed files with 8 additions and 8 deletions
|
@ -624,12 +624,12 @@ def integration_files_dir(salt_factories):
|
|||
Creates the directory if it does not yet exist.
|
||||
"""
|
||||
dirname = salt_factories.root_dir / "integration-files"
|
||||
int_files = os.path.join(
|
||||
salt_factories.code_dir, "tests", "pytests", "integration", "files"
|
||||
)
|
||||
if not os.path.exists(dirname):
|
||||
shutil.copytree(int_files, dirname)
|
||||
dirname.mkdir(exist_ok=True)
|
||||
for child in (PYTESTS_DIR / "integration" / "files").iterdir():
|
||||
if child.is_dir():
|
||||
shutil.copytree(str(child), str(dirname / child.name))
|
||||
else:
|
||||
shutil.copyfile(str(child), str(dirname / child.name))
|
||||
return dirname
|
||||
|
||||
|
||||
|
@ -1331,12 +1331,12 @@ def ssl_webserver(integration_files_dir, scope="module"):
|
|||
spins up an https webserver.
|
||||
"""
|
||||
context = ssl.SSLContext()
|
||||
root_dir = os.path.join(integration_files_dir, "https")
|
||||
context.load_cert_chain(
|
||||
os.path.join(root_dir, "cert.pem"), os.path.join(root_dir, "key.pem")
|
||||
str(integration_files_dir / "https" / "cert.pem"),
|
||||
str(integration_files_dir / "https" / "key.pem"),
|
||||
)
|
||||
|
||||
webserver = Webserver(root=integration_files_dir, ssl_opts=context)
|
||||
webserver = Webserver(root=str(integration_files_dir), ssl_opts=context)
|
||||
webserver.start()
|
||||
yield webserver
|
||||
webserver.stop()
|
||||
|
|
Loading…
Add table
Reference in a new issue