Publish curated Unraid-AppOps-Gateway source from f4a918d9dba3663faa1f675dcc335c9ec951f30c
This commit is contained in:
1 parent
f50d6e8c2c
commit
4f9c5a1106
4 files changed
+100
-6
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
def test_source_preflight_handles_recursive_yaml_lists_without_host_packages():
|
||||
source = ROOT / 'scripts/prepare_controller_hub_release_volume.py'
|
||||
program = """
|
||||
import importlib.util, sys
|
||||
spec = importlib.util.spec_from_file_location('controller', sys.argv[1])
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
module._preflight_source_compose(b'services: {deploy-control: {image: fixed}}\\nx-loop: &a [*a]\\n')
|
||||
try:
|
||||
module._preflight_source_compose(b'services: {deploy-control: {image: fixed}}\\nx-loop: &a [*a, {env_file: /tmp/secret}]\\n')
|
||||
except module.VolumeTransitionError as error:
|
||||
assert str(error) == 'controller_volume_external_source_invalid'
|
||||
else:
|
||||
raise AssertionError('external source inside alias accepted')
|
||||
"""
|
||||
result = subprocess.run([sys.executable, '-I', '-S', '-c', program, str(source)],
|
||||
capture_output=True, text=True, timeout=15, check=False)
|
||||
assert result.returncode == 0, result.stderr
|
||||
Reference in new issue
Block a user