Skip to content

Commit

Permalink
Begin fixing attach metadata tests
Browse files Browse the repository at this point in the history
  • Loading branch information
callumforrester committed Oct 23, 2023
1 parent 12db772 commit 71a86a0
Show file tree
Hide file tree
Showing 6 changed files with 353 additions and 284 deletions.
9 changes: 5 additions & 4 deletions src/blueapi/preprocessors/attach_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@


def attach_metadata(
data_groups: List[str],
provider: VisitDirectoryProvider,
plan: MsgGenerator,
provider: VisitDirectoryProvider,
) -> MsgGenerator:
"""Updates a directory provider default location for file storage."""
staging = False
Expand All @@ -26,10 +25,12 @@ def attach_metadata(
if (message.command == "stage") and (not staging and will_write_data):
yield from bps.wait_for([provider.update])
staging = True
elif message.command == "unstage":
staging = False

if message.command == "open_run":
message.kwargs[DATA_SESSION] = provider().filename_prefix
message.kwargs[DATA_GROUPS] = data_groups
directory_info = provider()
message.kwargs[DATA_SESSION] = directory_info.filename_prefix

yield message

Expand Down
7 changes: 5 additions & 2 deletions src/blueapi/service/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
from functools import partial
from typing import Mapping, Optional

from dodal.parameters.gda_directory_provider import VisitDirectoryProvider
from dodal.parameters.gda_directory_provider import (
VisitDirectoryProvider,
VisitServiceClient,
)

from blueapi.config import ApplicationConfig
from blueapi.core import BlueskyContext
Expand Down Expand Up @@ -90,9 +93,9 @@ def setup_handler(

if config:
provider = VisitDirectoryProvider(
url=config.env.data_writing.visit_service_url,
data_group_name=config.env.data_writing.group_name,
data_directory=config.env.data_writing.visit_directory,
client=VisitServiceClient(config.env.data_writing.visit_service_url),
)

# Make all dodal devices created by the context use provider if they can
Expand Down
27 changes: 0 additions & 27 deletions tests/plugins/file_writing_detector.py

This file was deleted.

251 changes: 0 additions & 251 deletions tests/plugins/test_data_writing.py

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 71a86a0

Please sign in to comment.