Add isolated Stimmatelier Qwen speech studio and restore recipe
This commit is contained in:
1 parent
182c8a1e8f
commit
2664ea8bd8
21 files changed
+397
-14
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import importlib.util,tempfile,threading,unittest
|
||||
from pathlib import Path
|
||||
from stimmatelier_proxy import asset
|
||||
class StudioProxyTests(unittest.TestCase):
|
||||
def test_unix_proxy_serves_only_fixed_assets_without_network_or_credentials(self):
|
||||
spec=importlib.util.spec_from_file_location('studio_app',Path(__file__).parent/'deploy/stimmatelier/app.py');module=importlib.util.module_from_spec(spec);spec.loader.exec_module(module)
|
||||
with tempfile.TemporaryDirectory(prefix='studio-',dir='/tmp') as d:
|
||||
root=Path(d);folder=root/'stimmatelier-ui';folder.mkdir()
|
||||
server=module.Server(str(folder/'ui.sock'),module.Handler);thread=threading.Thread(target=server.serve_forever);thread.start()
|
||||
try:
|
||||
data,mime=asset('/stimmatelier/',root);self.assertIn(b'Stimmatelier',data);self.assertIn('text/html',mime)
|
||||
with self.assertRaises(ValueError):asset('/stimmatelier/../../auth.json',root)
|
||||
finally:server.shutdown();server.server_close();thread.join()
|
||||
Reference in new issue
Block a user