mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
d8851e0011
commit
97331f3435
5 changed files with 31 additions and 11 deletions
|
|
@ -7,6 +7,7 @@ import json
|
|||
import os
|
||||
import pytest
|
||||
from sanic.request import Request
|
||||
import sqlite3
|
||||
import tempfile
|
||||
from unittest.mock import patch
|
||||
|
||||
|
|
@ -357,6 +358,14 @@ async def test_resolve_table_and_format(
|
|||
assert expected_format == actual_format
|
||||
|
||||
|
||||
def test_table_columns():
|
||||
conn = sqlite3.connect(":memory:")
|
||||
conn.executescript("""
|
||||
create table places (id integer primary key, name text, bob integer)
|
||||
""")
|
||||
assert ["id", "name", "bob"] == utils.table_columns(conn, "places")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"path,format,extra_qs,expected",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue