mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Add register_actions hook to test plugin and improve test
This commit is contained in:
parent
130dad268d
commit
d73b6f169f
3 changed files with 28 additions and 0 deletions
|
|
@ -1560,6 +1560,17 @@ async def test_hook_register_events():
|
|||
assert any(k.__name__ == "OneEvent" for k in datasette.event_classes)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_hook_register_actions():
|
||||
datasette = Datasette(memory=True, plugins_dir=PLUGINS_DIR)
|
||||
await datasette.invoke_startup()
|
||||
# Check that the custom action from my_plugin.py is registered
|
||||
assert "view-collection" in datasette.actions
|
||||
action = datasette.actions["view-collection"]
|
||||
assert action.abbr == "vc"
|
||||
assert action.description == "View a collection"
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="TODO")
|
||||
@pytest.mark.parametrize(
|
||||
"metadata,config,expected_metadata,expected_config",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue