MCPcopy Index your code
hub / github.com/coder/coder / TestProtoFromLifecycle

Function TestProtoFromLifecycle

codersdk/agentsdk/convert_test.go:184–196  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

182}
183
184func TestProtoFromLifecycle(t *testing.T) {
185 t.Parallel()
186 now := dbtime.Now()
187 for _, s := range codersdk.WorkspaceAgentLifecycleOrder {
188 sr := agentsdk.PostLifecycleRequest{State: s, ChangedAt: now}
189 pr, err := agentsdk.ProtoFromLifecycle(sr)
190 require.NoError(t, err)
191 require.Equal(t, now, pr.ChangedAt.AsTime())
192 state, err := agentsdk.LifecycleStateFromProto(pr.State)
193 require.NoError(t, err)
194 require.Equal(t, s, state)
195 }
196}
197
198func TestProtoFromMetadataResult(t *testing.T) {
199 t.Parallel()

Callers

nothing calls this directly

Calls 4

NowFunction · 0.92
ProtoFromLifecycleFunction · 0.92
LifecycleStateFromProtoFunction · 0.92
EqualMethod · 0.45

Tested by

no test coverage detected