MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / test_server_lifecycle

Function test_server_lifecycle

src/server/lifecycle.rs:97–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95
96 #[test]
97 fn test_server_lifecycle() {
98 let app_context = AppContext::builder().build();
99 let tsk_env = app_context.tsk_env();
100
101 let lifecycle = ServerLifecycle::new(tsk_env);
102
103 assert!(!lifecycle.is_server_running());
104
105 lifecycle.write_pid().unwrap();
106 assert!(lifecycle.is_server_running());
107
108 let pid = lifecycle.read_pid().unwrap();
109 assert_eq!(pid, process::id());
110
111 lifecycle.cleanup().unwrap();
112 assert!(!lifecycle.is_server_running());
113 }
114}

Callers

nothing calls this directly

Calls 5

tsk_envMethod · 0.80
write_pidMethod · 0.80
read_pidMethod · 0.80
cleanupMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected