3 ms·
I've found writing tests against these endpoints to be pretty easy - I populate the associated database table with one record more than the default page size an
by simonw 5y ago
I've found writing tests against these endpoints to be pretty easy - I populate the associated database table with one record more than the default page size and then run a test that retrieves the full result and checks that the expected records are present. No need to run tests that generate 100MB responses every time - though I will do a few manual tests of large responses to check that RAM usage is as-expected.
Here's my test in Datasette for the streaming CSV response - I already have a table with 1001 items in it setup for another test: https://github.com/simonw/datasette/blob/0.57.1/tests/test_csv.py#L155-L161 https://github.com/simonw/datasette/blob/0.57.1/tests/test_c...