controller: turn an archetype agent into a custom one
This commit is contained in:
parent
8a7f254c74
commit
0737798d78
1 changed files with 1008 additions and 44 deletions
|
|
@ -407,7 +407,10 @@ struct Snapshot {
|
|||
fn snapshot() -> Snapshot {
|
||||
Snapshot {
|
||||
readiness: crate::warnings::readiness(),
|
||||
capabilities: &[swarm_wire::hive_status::TOLERANT_PERMISSIONS],
|
||||
capabilities: &[
|
||||
swarm_wire::hive_status::TOLERANT_PERMISSIONS,
|
||||
swarm_wire::hive_status::NO_CONFIG_CHECKOUT,
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -449,12 +452,16 @@ mod snapshot_tests {
|
|||
/// The controller reads the capability out of the published bytes with
|
||||
/// the wire type, and the readiness keeps its own top-level fields.
|
||||
#[test]
|
||||
fn the_snapshot_advertises_tolerant_permissions_beside_the_readiness() {
|
||||
fn the_snapshot_advertises_its_capabilities_beside_the_readiness() {
|
||||
let value = serde_json::to_value(snapshot()).unwrap();
|
||||
assert!(
|
||||
swarm_wire::hive_status::Capabilities::of_snapshot(&value)
|
||||
.has(swarm_wire::hive_status::TOLERANT_PERMISSIONS)
|
||||
);
|
||||
assert!(
|
||||
swarm_wire::hive_status::Capabilities::of_snapshot(&value)
|
||||
.has(swarm_wire::hive_status::NO_CONFIG_CHECKOUT)
|
||||
);
|
||||
assert!(value.get("status").is_some() && value.get("warnings").is_some());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue