first commit
This commit is contained in:
41 files changed
+4964
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"""Temporary local UI fixture; never contacts the news API or forum."""
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import tempfile
|
||||
from http.server import ThreadingHTTPServer
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
from app import Controller, make_handler
|
||||
with tempfile.TemporaryDirectory() as temp:
|
||||
controller = Controller(Path(temp) / 'data', Path(temp) / 'downloads', ledger=None)
|
||||
controller.store.enqueue(ROOT / 'test/fixtures/article')
|
||||
server = ThreadingHTTPServer(('127.0.0.1', 8771), make_handler(controller))
|
||||
print('UI fixture listening on 8771', flush=True)
|
||||
try:
|
||||
server.serve_forever()
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
finally:
|
||||
server.server_close()
|
||||
Reference in new issue
Block a user