diff --git a/tests/fixtures.py b/tests/fixtures.py index ace1f7e6..f37cebd5 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -17,7 +17,8 @@ def app_client(sql_time_limit_ms=None, max_returned_rows=None, config=None): os.chdir(os.path.dirname(filepath)) plugins_dir = os.path.join(tmpdir, 'plugins') os.mkdir(plugins_dir) - open(os.path.join(plugins_dir, 'my_plugin.py'), 'w').write(PLUGIN) + open(os.path.join(plugins_dir, 'my_plugin.py'), 'w').write(PLUGIN1) + open(os.path.join(plugins_dir, 'my_plugin_2.py'), 'w').write(PLUGIN2) config = config or {} config.update({ 'default_page_size': 50, @@ -114,7 +115,7 @@ METADATA = { } } -PLUGIN = ''' +PLUGIN1 = ''' from datasette import hookimpl import pint @@ -137,9 +138,21 @@ def extra_css_urls(): @hookimpl def extra_js_urls(): return [{ - 'url': 'https://example.com/app.js', + 'url': 'https://example.com/jquery.js', 'sri': 'SRIHASH', - }] + }, 'https://example.com/plugin1.js'] +''' + +PLUGIN2 = ''' +from datasette import hookimpl + + +@hookimpl +def extra_js_urls(): + return [{ + 'url': 'https://example.com/jquery.js', + 'sri': 'SRIHASH', + }, 'https://example.com/plugin2.js'] ''' TABLES = ''' diff --git a/tests/test_api.py b/tests/test_api.py index 24bfbc65..02670748 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -868,14 +868,6 @@ def test_unit_filters(app_client): assert data['rows'][0][0] == 2 -def test_plugins_dir_plugin(app_client): - response = app_client.get( - "/test_tables.json?sql=select+convert_units(100%2C+'m'%2C+'ft')", - gather_request=False - ) - assert pytest.approx(328.0839) == response.json['rows'][0][0] - - def test_metadata_json(app_client): response = app_client.get( "/-/metadata.json",