feat: wire relay API with dependency injection
- split settings module into per-struct files
- add DatabaseSettings with default in-memory SQLite path
- implement RelayApi struct with GET /relays and POST
/relays/{id}/toggle
- wire create_relay_controller and create_label_repository into
Application::build() with mock/real selection via cfg!(test) || CI
- register RelayApi in OpenApiService alongside existing APIs
This commit is contained in:
@@ -265,9 +265,15 @@ mod tests {
|
||||
for (index, relay) in result.iter().enumerate() {
|
||||
let relay_num = index + 1;
|
||||
if relay_num % 2 == 1 {
|
||||
assert!(relay.label().is_some(), "Relay {relay_num} should have label");
|
||||
assert!(
|
||||
relay.label().is_some(),
|
||||
"Relay {relay_num} should have label"
|
||||
);
|
||||
} else {
|
||||
assert!(relay.label().is_none(), "Relay {relay_num} should not have label");
|
||||
assert!(
|
||||
relay.label().is_none(),
|
||||
"Relay {relay_num} should not have label"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user