1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
mod common;
#[test]
fn test_graph_pod_rename_operations() {
let (mut graph, _temp_dir) = common::create_test_graph();
// Create a mock pod entry in the graph
let pod_address = "test_pod_address";
let initial_name = "InitialPodName";
// Add a pod entry to the graph
graph
.force_set_pod_depth(pod_address, initial_name, 0)
.unwrap();
// Rename the pod in the graph
let _updated_graph = graph.rename_pod_entry(pod_address, "RenamedPod").unwrap();
// Verify the rename worked by checking if we can find the pod with the new name
// Note: This is a simplified test since the actual rename_pod_entry function
// returns graph data that would be processed by the PodManager
// The fact that rename_pod_entry didn't return an error indicates success
// A more comprehensive test would require mocking the entire PodManager workflow
}
#[test]
fn test_graph_pod_removal_operations() {
let (mut graph, _temp_dir) = common::create_test_graph();
// Create a mock pod entry in the graph
let pod_address = "test_pod_address";
let pod_name = "TestPod";
// Add a pod entry to the graph
graph.force_set_pod_depth(pod_address, pod_name, 0).unwrap();
// Verify the pod exists
let depth = graph.get_pod_depth(pod_address).unwrap();
assert_ne!(depth, u64::MAX, "Pod should exist in graph");
// Remove the pod from the graph (simulating what remove_pod_entry would do)
let scratchpads = vec![];
let config_address = "config_address";
let _result = graph.remove_pod_entry(pod_address, scratchpads, config_address);
// The fact that remove_pod_entry didn't panic indicates the operation completed
// A more comprehensive test would require mocking the entire PodManager workflow
}