mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Experimental new table / encoding schema
See https://github.com/django/asgiref/issues/51#issuecomment-450603464
This commit is contained in:
parent
a2bfcfc1b1
commit
0f3b35d4e8
11 changed files with 53 additions and 18 deletions
|
|
@ -374,3 +374,16 @@ def test_path_with_format(path, format, extra_qs, expected):
|
|||
)
|
||||
actual = utils.path_with_format(request, format, extra_qs)
|
||||
assert expected == actual
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,expected", [
|
||||
("table", "table"),
|
||||
("table/and/slashes", "tableU+002FandU+002Fslashes"),
|
||||
("~table", "U+007Etable"),
|
||||
("+bobcats!", "U+002Bbobcats!"),
|
||||
("U+007Etable", "UU+002B007Etable"),
|
||||
])
|
||||
def test_encode_decode_table_name(name, expected):
|
||||
encoded = utils.encode_table_name(name)
|
||||
assert encoded == expected
|
||||
assert name == utils.decode_table_name(encoded)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue