Skip to content

Commit

Permalink
fix returning status for PEPhub backend
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Jul 12, 2024
1 parent 6523c02 commit 25b0b3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions pipestat/backends/pephub_backend/pephubbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ def get_status(self, record_identifier: str) -> Optional[str]:
except IndexError or KeyError:
status = None

if status == "": # PEPhub returns '' for empty cell
status = None
return status

def select_records(
Expand Down
14 changes: 9 additions & 5 deletions tests/test_pipestat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2607,7 +2607,7 @@ def test_pephub_backend_retrieve_many(

assert len(results["records"]) == 2

def test_get_status_pephub_backend(
def test_set_status_pephub_backend(
self,
config_file_path,
schema_file_path,
Expand All @@ -2618,25 +2618,29 @@ def test_get_status_pephub_backend(

psm = PipestatManager(pephub_path=PEPHUB_URL, schema_path=schema_file_path)

result = psm.get_status(record_identifier=rec_ids[0])
result = psm.set_status(record_identifier=rec_ids[0], status_identifier="completed")

assert result is None

def test_set_status_pephub_backend(
def test_get_status_pephub_backend(
self,
config_file_path,
schema_file_path,
results_file_path,
range_values,
):
rec_ids = ["test_pipestat_01"]
rec_ids = ["sample1", "test_pipestat_01"]

psm = PipestatManager(pephub_path=PEPHUB_URL, schema_path=schema_file_path)

result = psm.set_status(record_identifier=rec_ids[0], status_identifier="completed")
result = psm.get_status(record_identifier=rec_ids[0])

assert result is None

result = psm.get_status(record_identifier=rec_ids[1])

assert result == "completed"

def test_pephub_backend_remove(
self,
config_file_path,
Expand Down

0 comments on commit 25b0b3f

Please sign in to comment.