mirror of
https://github.com/simonw/datasette.git
synced 2026-06-01 06:37:02 +02:00
black format fixes
This commit is contained in:
parent
32fc6e87b1
commit
294be58fb8
2 changed files with 7 additions and 4 deletions
|
|
@ -878,7 +878,7 @@ class LoadExtension(click.ParamType):
|
|||
path_entry = value.split(":", 2)
|
||||
if len(path_entry) < 3:
|
||||
return value
|
||||
#argument contains a Windows/DOS path and an entry point
|
||||
# argument contains a Windows/DOS path and an entry point
|
||||
path = path_entry[0] + ":" + path_entry[1]
|
||||
entrypoint = path_entry[-1]
|
||||
return path, entrypoint
|
||||
|
|
|
|||
|
|
@ -1,28 +1,31 @@
|
|||
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"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue