Added /-/versions and /-/versions.json, closes #244

Sample output:

    {
      "python": {
        "version": "3.6.3",
        "full": "3.6.3 (default, Oct  4 2017, 06:09:38) \n[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]"
      },
      "datasette": {
        "version": "0.20"
      },
      "sqlite": {
        "version": "3.23.1",
        "extensions": {
          "json1": null,
          "spatialite": "4.3.0a"
        }
      }
    }
This commit is contained in:
Simon Willison 2018-05-02 01:46:54 -07:00
commit bb87cf8730
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
2 changed files with 53 additions and 0 deletions

View file

@ -765,6 +765,20 @@ def test_plugins_json(app_client):
} in response.json
def test_versions_json(app_client):
response = app_client.get(
"/-/versions.json",
gather_request=False
)
assert 'python' in response.json
assert 'version' in response.json['python']
assert 'full' in response.json['python']
assert 'datasette' in response.json
assert 'version' in response.json['datasette']
assert 'sqlite' in response.json
assert 'version' in response.json['sqlite']
def test_page_size_matching_max_returned_rows(app_client_returend_rows_matches_page_size):
fetched = []
path = '/test_tables/no_primary_key.json'