mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
conf/test_install_lib.sh tested conf/install-lib.sh, but no CI step or test ran it. It moves to webvirtcloud/tests/sh/install_lib.test.sh, takes the library's path as its argument, and test_install_lib runs it in bash, as the JS tests run in node.
20 lines
654 B
Python
20 lines
654 B
Python
"""The installer's functions (conf/install-lib.sh), tested in bash."""
|
|
|
|
import shutil
|
|
import subprocess
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
from django.conf import settings
|
|
|
|
BASE = Path(settings.BASE_DIR)
|
|
|
|
|
|
class InstallLibTestCase(unittest.TestCase):
|
|
@unittest.skipUnless(shutil.which("bash"), "bash is not installed")
|
|
def test_install_lib(self):
|
|
result = subprocess.run(
|
|
["bash", str(BASE / "webvirtcloud/tests/sh/install_lib.test.sh"), str(BASE / "conf/install-lib.sh")],
|
|
capture_output=True, text=True, timeout=120,
|
|
)
|
|
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|