Skip to content

Commit

Permalink
(DiamondLightSource/hyperion#1343) Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram committed May 16, 2024
1 parent 2583a98 commit 370f549
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dodal/devices/areadetector/plugins/MJPG.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def _save_image(self, image: Image.Image):
and filename signals. The full resultant path is put on the last_saved_path signal
"""
filename_str = self.filename.get()
directory_str = Path(self.directory.get()) # type: ignore
directory_str: str = self.directory.get() # type: ignore

path = Path(f"{directory_str}/{filename_str}.png").as_posix()
if not os.path.isdir(directory_str):
if not os.path.isdir(Path(directory_str)):
LOGGER.info(f"Snapshot folder {directory_str} does not exist, creating...")
os.mkdir(directory_str)

Expand Down
3 changes: 1 addition & 2 deletions tests/devices/unit_tests/test_oav.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from pathlib import PosixPath
from unittest.mock import MagicMock, call, patch

import numpy as np
Expand Down Expand Up @@ -94,7 +93,7 @@ def test_given_directory_not_existing_when_snapshot_triggered_then_directory_cre
mock_os.path.isdir.return_value = False
st = fake_oav.grid_snapshot.trigger()
st.wait()
mock_os.mkdir.assert_called_once_with(PosixPath("test directory"))
mock_os.mkdir.assert_called_once_with("test directory")


@patch("requests.get")
Expand Down

0 comments on commit 370f549

Please sign in to comment.