Skip to content

Commit

Permalink
add test for construction of section data with Path objects and fix b…
Browse files Browse the repository at this point in the history
…ug found by Morgan Beeby (#26)
  • Loading branch information
alisterburt authored May 8, 2024
1 parent 96b7b22 commit 7084db9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mdocfile/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class MdocSectionData(BaseModel):
AlignedPieceCoords: Optional[Union[Tuple[float, float], Tuple[float, float, float]]] = None
AlignedPieceCoordsVS: Optional[
Union[Tuple[float, float], Tuple[float, float, float]]] = None
SubFramePath: Optional[PureWindowsPath] = None
SubFramePath: Optional[Union[PureWindowsPath, Path]] = None
NumSubFrames: Optional[int] = None
FrameDosesAndNumbers: Optional[Sequence[Tuple[float, int]]] = None
DateTime: Optional[str] = None
Expand Down
3 changes: 3 additions & 0 deletions tests/test_data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,6 @@ def test_to_string_is_valid_mdoc(tilt_series_mdoc_file):
for (k1, v1), (k2, v2) in zip(mdoc_dict.items(), mdoc2_dict.items()):
assert v1 == v2
assert k1 == k2

def test_section_data_from_path():
section = MdocSectionData(SubFramePath=Path('bla.tif'))

0 comments on commit 7084db9

Please sign in to comment.