Added plugin_config() method

This commit is contained in:
Simon Willison 2018-08-28 01:35:21 -07:00
commit 0a14a4846b
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
6 changed files with 114 additions and 6 deletions

View file

@ -85,3 +85,20 @@ def test_plugins_render_cell(app_client):
assert a is not None, str(a)
assert a.attrs["href"] == "http://example.com/"
assert a.text == "Example"
def test_plugin_config(app_client):
assert {"depth": "table"} == app_client.ds.plugin_config(
"name-of-plugin", database="fixtures", table="sortable"
)
assert {"depth": "database"} == app_client.ds.plugin_config(
"name-of-plugin", database="fixtures", table="unknown_table"
)
assert {"depth": "database"} == app_client.ds.plugin_config(
"name-of-plugin", database="fixtures"
)
assert {"depth": "root"} == app_client.ds.plugin_config(
"name-of-plugin", database="unknown_database"
)
assert {"depth": "root"} == app_client.ds.plugin_config("name-of-plugin")
assert None is app_client.ds.plugin_config("unknown-plugin")