DiamondLightSource / DiamondLightSource/blueapi

Simplify Access Token Injection for BlueAPI Client in System Tests

Open
#1,070 2 comments 0 reactions 0 assignees View on GitHub
auth needs confirmation tests
Dominant language
Python
Stars
13
Forks
13
Avg merge
2d 11h
Merged PRs (30d)
25

Description

Currently, in the system tests, we patch the blueapi client and manually inject the access token as a side effect. This approach is not ideal, as it adds complexity and reduces clarity in the test setup.

Reference:
https://github.com/DiamondLightSource/htss-rig-bluesky/blob/main/tests/system_tests/conftest.py#L79

We should introduce a clean and simple mechanism to add the access token directly, without requiring a login or patching the client.

## Acceptance Criteria
- The blueapi client can accept an access token directly via a simple, public interface—no patching required in system tests.
- The code in the system tests is refactored to use this mechanism, improving clarity and maintainability.
- The existing functionality remains unchanged and is not broken by this update.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.