Add test for UTF8
This commit is contained in:
@@ -18,6 +18,7 @@ from .database import get_operation_by_snapshot, get_snapshot_by_operation
|
||||
from .database import pick_snapshot
|
||||
from .database import pick_operation, sync_with_server
|
||||
from .database import get_restore_operation, set_restore_operation, set_restore_operation_to_current, restore
|
||||
from .database import read, try_read, read_all, write
|
||||
|
||||
from .batch_exe import execute_batch_commands, execute_batch_command
|
||||
|
||||
|
||||
@@ -19,6 +19,21 @@ class TestApi:
|
||||
delete_project(p)
|
||||
|
||||
|
||||
# encoding
|
||||
|
||||
|
||||
def test_utf8(self):
|
||||
p = 'test_utf8'
|
||||
self.enter(p)
|
||||
|
||||
write(p, f"create table {p} (a varchar(32))")
|
||||
write(p, f"insert into {p} values ('你好')")
|
||||
result = read_all(p, f"select * from { p}")
|
||||
assert result == [{'a': '你好'}]
|
||||
|
||||
self.leave(p)
|
||||
|
||||
|
||||
# project
|
||||
|
||||
|
||||
|
||||
12
tjnetwork.py
12
tjnetwork.py
@@ -308,6 +308,18 @@ def set_restore_operation_to_current(name: str) -> None:
|
||||
def restore(name: str, discard: bool = False) -> ChangeSet:
|
||||
return api.restore(name, discard)
|
||||
|
||||
def read(name: str, sql: str):
|
||||
return api.read(name, sql)
|
||||
|
||||
def try_read(name: str, sql: str):
|
||||
return api.try_read(name, sql)
|
||||
|
||||
def read_all(name: str, sql: str):
|
||||
return api.read_all(name, sql)
|
||||
|
||||
def write(name: str, sql: str):
|
||||
return api.write(name, sql)
|
||||
|
||||
|
||||
############################################################
|
||||
# type
|
||||
|
||||
Reference in New Issue
Block a user