mirror of
https://github.com/simonw/datasette.git
synced 2026-06-06 17:16:57 +02:00
Expanded analysis of SQL operations, refs #2748
This commit is contained in:
parent
9f66cf72c1
commit
737ff03efb
9 changed files with 740 additions and 120 deletions
|
|
@ -12,10 +12,22 @@ import pytest
|
|||
import pytest_asyncio
|
||||
from datasette.app import Datasette
|
||||
from datasette.permissions import PermissionSQL
|
||||
from datasette.resources import TableResource
|
||||
from datasette.resources import DatabaseResource, QueryResource, TableResource
|
||||
from datasette import hookimpl
|
||||
|
||||
|
||||
def test_resource_string_representations():
|
||||
assert str(DatabaseResource("content")) == "content"
|
||||
assert repr(DatabaseResource("content")) == (
|
||||
"DatabaseResource(parent='content', child=None)"
|
||||
)
|
||||
assert str(TableResource("content", "dogs")) == "content/dogs"
|
||||
assert repr(TableResource("content", "dogs")) == (
|
||||
"TableResource(parent='content', child='dogs')"
|
||||
)
|
||||
assert str(QueryResource("content", "insert-a-dog")) == "content/insert-a-dog"
|
||||
|
||||
|
||||
# Test plugin that provides permission rules
|
||||
class PermissionRulesPlugin:
|
||||
def __init__(self, rules_callback):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue