?_shape=arrayfirst, closes #287

This commit is contained in:
Simon Willison 2018-05-26 17:32:15 -07:00
commit 276913b748
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
3 changed files with 19 additions and 1 deletions

View file

@ -433,6 +433,17 @@ def test_table_shape_arrays(app_client):
] == response.json['rows']
def test_table_shape_arrayfirst(app_client):
response = app_client.get(
'/test_tables.json?' + urllib.parse.urlencode({
'sql': 'select content from simple_primary_key order by id',
'_shape': 'arrayfirst'
}),
gather_request=False
)
assert ['hello', 'world', ''] == response.json
def test_table_shape_objects(app_client):
response = app_client.get(
'/test_tables/simple_primary_key.json?_shape=objects',