MCPcopy
hub / github.com/cli/cli / verifyNotifyCodespaceOfClientActivity

Function verifyNotifyCodespaceOfClientActivity

internal/codespaces/rpc/invoker_test.go:89–103  ·  view source on GitHub ↗

Test that the RPC invoker notifies the codespace of client activity on connection

(t *testing.T, server *mockServer)

Source from the content-addressed store, hash-verified

87
88// Test that the RPC invoker notifies the codespace of client activity on connection
89func verifyNotifyCodespaceOfClientActivity(t *testing.T, server *mockServer) {
90 calls := server.CodespaceHostServerMock.NotifyCodespaceOfClientActivityCalls()
91 if len(calls) == 0 {
92 t.Fatalf("no client activity calls")
93 }
94
95 for _, call := range calls {
96 activities := call.NotifyCodespaceOfClientActivityRequest.GetClientActivities()
97 if activities[0] == connectedEventName {
98 return
99 }
100 }
101
102 t.Fatalf("no activity named %s", connectedEventName)
103}
104
105// Test that the RPC invoker returns the correct port and URL when the JupyterLab server starts successfully
106func TestStartJupyterServerSuccess(t *testing.T) {

Tested by

no test coverage detected