sqlite-utils/tests/test_introspect.py
2018-07-31 08:55:24 -07:00

16 lines
400 B
Python

from .fixtures import existing_db
def test_count(existing_db):
assert 3 == existing_db["foo"].count
def test_columns(existing_db):
table = existing_db["foo"]
assert [{"name": "text", "type": "TEXT"}] == [
{"name": col.name, "type": col.type} for col in table.columns
]
def test_schema(existing_db):
assert "CREATE TABLE foo (text TEXT)" == existing_db["foo"].schema