use correct separator.

This commit is contained in:
mike cullerton 2022-11-21 12:05:25 -05:00
parent 168ce9cff3
commit f0103fb29d
3 changed files with 13 additions and 3 deletions

View File

@ -31,10 +31,17 @@ class FileSystemService:
app_root = current_app.root_path
return os.path.join(app_root, "..", dir_name)
@staticmethod
def id_string_to_relative_path(id_string):
return id_string.replace("/", os.sep)
@staticmethod
def process_group_path(name: str) -> str:
"""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
def full_path_from_relative_path(relative_path: str) -> str:

View File

@ -207,7 +207,10 @@ class ProcessModelService(FileSystemService):
"""Look for a given process_group, and return it."""
if os.path.exists(FileSystemService.root_path()):
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):
return self.__scan_process_group(process_group_path)

View File

@ -2384,7 +2384,7 @@ class TestProcessApi(BaseTest):
for group in groups:
persisted = ProcessModelService().get_process_group(group)
assert persisted is not None
assert persisted.id_for_file_path() == group
assert persisted.id == group
def test_move_model(
self,