Skip to content
Snippets Groups Projects
Commit 2a81f7a7 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Bypass changing paths if new path is the same as old one

parent d5e09c44
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,8 @@ def list_session_paths():
def change_path(key, path):
try:
if session.get_paths()[key] == path:
return session.get_paths()
session.set_data_directory(key, path)
except InvalidPathError as e:
raise HTTPException(
......
from pathlib import Path
import re
from time import localtime, strftime
from typing import List
import pandas as pd
from model_server.accessors import InMemoryDataAccessor, write_accessor_data_to_file
from model_server.models import Model
def autonumber_new_directory(where: str, prefix: str) -> str:
"""
......@@ -75,6 +77,7 @@ def loop_workflow(
files: list,
output_folder_path: str,
workflow_func: callable,
models: List[Model],
params: dict,
export_batch_csvs: bool = True,
write_intermediate_products: bool = True,
......@@ -95,6 +98,7 @@ def loop_workflow(
export_kwargs = {
'input_file_path': ff,
'output_folder_path': output_folder_path,
'models': models,
**params,
}
......
......@@ -155,4 +155,20 @@ class TestApiFromAutomatedClient(TestServerBaseClass):
resp_check = requests.get(
self.uri + 'paths'
)
self.assertEqual(resp_inpath.json()['inbound_images'], resp_check.json()['inbound_images'])
\ No newline at end of file
self.assertEqual(resp_inpath.json()['outbound_images'], resp_check.json()['outbound_images'])
def test_no_change_inbound_path(self):
resp_inpath = requests.get(
self.uri + 'paths'
)
resp_change = requests.put(
self.uri + f'paths/watch_output',
params={
'path': resp_inpath.json()['outbound_images']
}
)
self.assertEqual(resp_change.status_code, 200)
resp_check = requests.get(
self.uri + 'paths'
)
self.assertEqual(resp_inpath.json()['outbound_images'], resp_check.json()['outbound_images'])
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment