feat(feeds): add opt-in Gecko relay and folder shortcuts
Document engine redistribution requirements; exclude upstream engine assets and keep the viewer disabled by default.
This commit is contained in:
1 parent
b23e63d4c6
commit
5321d613b4
37 files changed
+2051
-29
No files matched your search
@@ -1,6 +1,10 @@
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
import sqlite3
|
||||
import io
|
||||
from contextlib import redirect_stdout
|
||||
from types import SimpleNamespace
|
||||
|
||||
|
||||
SCRIPT = Path(__file__).with_name("pageswiki-cli")
|
||||
@@ -43,5 +47,23 @@ class ContentTypeDetectionTest(unittest.TestCase):
|
||||
self.assertEqual(content_type, "text/plain; charset=shift_jis")
|
||||
|
||||
|
||||
class ExtensionDefaultTest(unittest.TestCase):
|
||||
def test_gecko_is_opt_in(self) -> None:
|
||||
db = sqlite3.connect(":memory:")
|
||||
self.addCleanup(db.close)
|
||||
db.execute("CREATE TABLE config(domain_uuid TEXT,key TEXT,value TEXT,updated_at INTEGER,UNIQUE(domain_uuid,key))")
|
||||
# Exercise the CLI command without reading any deployment database.
|
||||
owner = next(value for value in vars(pageswiki_cli).values() if isinstance(value, type) and hasattr(value, "command_extension"))
|
||||
fixture = SimpleNamespace(db=db, domain_uuid="synthetic")
|
||||
output = io.StringIO()
|
||||
with redirect_stdout(output):
|
||||
owner.command_extension(fixture, ["viewer.gecko"])
|
||||
owner.command_extension(fixture, ["viewer.gecko", "on"])
|
||||
owner.command_extension(fixture, ["viewer.gecko"])
|
||||
owner.command_extension(fixture, ["viewer.gecko", "off"])
|
||||
owner.command_extension(fixture, ["viewer.gecko"])
|
||||
self.assertEqual(output.getvalue().splitlines(), ["viewer.gecko\tdisabled", "viewer.gecko\ton", "viewer.gecko\tenabled", "viewer.gecko\toff", "viewer.gecko\tdisabled"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user