mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-02-24 15:18:27 +00:00
use correct separator.
This commit is contained in:
parent
788ee628d4
commit
77a76a7529
@ -31,10 +31,17 @@ class FileSystemService:
|
|||||||
app_root = current_app.root_path
|
app_root = current_app.root_path
|
||||||
return os.path.join(app_root, "..", dir_name)
|
return os.path.join(app_root, "..", dir_name)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def id_string_to_relative_path(id_string):
|
||||||
|
return id_string.replace("/", os.sep)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def process_group_path(name: str) -> str:
|
def process_group_path(name: str) -> str:
|
||||||
"""Category_path."""
|
"""Category_path."""
|
||||||
return os.path.abspath(os.path.join(FileSystemService.root_path(), name))
|
return os.path.abspath(os.path.join(
|
||||||
|
FileSystemService.root_path(),
|
||||||
|
FileSystemService.id_string_to_relative_path(name)
|
||||||
|
))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def full_path_from_relative_path(relative_path: str) -> str:
|
def full_path_from_relative_path(relative_path: str) -> str:
|
||||||
|
@ -207,7 +207,10 @@ class ProcessModelService(FileSystemService):
|
|||||||
"""Look for a given process_group, and return it."""
|
"""Look for a given process_group, and return it."""
|
||||||
if os.path.exists(FileSystemService.root_path()):
|
if os.path.exists(FileSystemService.root_path()):
|
||||||
process_group_path = os.path.abspath(
|
process_group_path = os.path.abspath(
|
||||||
os.path.join(FileSystemService.root_path(), process_group_id)
|
os.path.join(
|
||||||
|
FileSystemService.root_path(),
|
||||||
|
FileSystemService.id_string_to_relative_path(process_group_id)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
if self.is_group(process_group_path):
|
if self.is_group(process_group_path):
|
||||||
return self.__scan_process_group(process_group_path)
|
return self.__scan_process_group(process_group_path)
|
||||||
|
@ -2384,7 +2384,7 @@ class TestProcessApi(BaseTest):
|
|||||||
for group in groups:
|
for group in groups:
|
||||||
persisted = ProcessModelService().get_process_group(group)
|
persisted = ProcessModelService().get_process_group(group)
|
||||||
assert persisted is not None
|
assert persisted is not None
|
||||||
assert persisted.id_for_file_path() == group
|
assert persisted.id == group
|
||||||
|
|
||||||
def test_move_model(
|
def test_move_model(
|
||||||
self,
|
self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user