MCPcopy Create free account
hub / github.com/calfonso/rusternetes / test_node_update

Function test_node_update

crates/api-server/tests/node_handler_test.rs:101–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99
100#[tokio::test]
101async fn test_node_update() {
102 let storage = Arc::new(MemoryStorage::new());
103
104 let mut node = create_test_node("test-update-node");
105 let key = build_key("nodes", None, "test-update-node");
106
107 // Create
108 storage.create(&key, &node).await.unwrap();
109
110 // Update to unschedulable
111 node.spec.as_mut().unwrap().unschedulable = Some(true);
112 let updated: Node = storage.update(&key, &node).await.unwrap();
113 assert_eq!(updated.spec.as_ref().unwrap().unschedulable, Some(true));
114
115 // Verify update
116 let retrieved: Node = storage.get(&key).await.unwrap();
117 assert_eq!(retrieved.spec.as_ref().unwrap().unschedulable, Some(true));
118
119 // Clean up
120 storage.delete(&key).await.unwrap();
121}
122
123#[tokio::test]
124async fn test_node_delete() {

Callers

nothing calls this directly

Calls 6

build_keyFunction · 0.85
create_test_nodeFunction · 0.70
createMethod · 0.45
updateMethod · 0.45
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected