tests proposed code for #2198

pull/2339/head
antigrav_kids 2024-04-27 23:28:21 -07:00
rodzic 8f9509f00c
commit 2ecab3213c
1 zmienionych plików z 28 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,28 @@
from datasette.utils import LoadExtension
def test_dos_path():
path_string = "C:\Windows\System32\mod_spatialite.dll"
le = LoadExtension()
path = le.convert(path_string, None, None)
assert path == "C:\Windows\System32\mod_spatialite.dll"
def test_dos_pathentry():
path_entry = "C:\Windows\System32\mod_spatialite.dll:testentry"
le = LoadExtension()
pathen, entry = le.convert(path_entry, None, None)
assert pathen == "C:\Windows\System32\mod_spatialite.dll"
assert entry == "testentry"
def test_linux_path():
path_string = "/base/test/test2"
le = LoadExtension()
path = le.convert(path_string, None, None)
assert path == path_string
def test_linux_path_entry():
path_string = "/base/test/test2:testentry"
le = LoadExtension()
path, entry = le.convert(path_string, None, None)
assert path == "/base/test/test2"
assert entry == "testentry"