Data path based on containing DIR location
This commit is contained in:
parent
92e5541267
commit
5a2787a039
1 changed files with 5 additions and 1 deletions
|
|
@ -9,11 +9,14 @@ objects to simulate real camera captures.
|
|||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
from labthings_fastapi.testing import create_thing_without_server
|
||||
|
||||
from openflexure_microscope_server.things.autofocus import AutofocusThing
|
||||
|
||||
THIS_DIR = os.path.dirname(__file__)
|
||||
DATA_PATH = os.path.join(THIS_DIR, "data", "sharpness_test_cases.json")
|
||||
|
||||
class MockCapture:
|
||||
"""Simple mock object representing a captured image.
|
||||
|
|
@ -53,7 +56,8 @@ def test_stack_labelling():
|
|||
Expected labels may be a single value or a list of acceptable values.
|
||||
"""
|
||||
autofocus_thing = create_thing_without_server(AutofocusThing, mock_all_slots=True)
|
||||
with open(r"tests\unit_tests\data\sharpness_test_cases.json") as f:
|
||||
|
||||
with open(DATA_PATH) as f:
|
||||
data = json.load(f)
|
||||
|
||||
success = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue