MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / MustTFromContext

Function MustTFromContext

pkg/util/test/context.go:58–64  ·  view source on GitHub ↗

MustTFromContext returns the *testing.T from the context, and panics if it was not saved in the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

56
57// MustTFromContext returns the *testing.T from the context, and panics if it was not saved in the context.
58func MustTFromContext(ctx context.Context) *testing.T {
59 t, ok := TFromContext(ctx)
60 if !ok {
61 panic("*testing.T not present in the context")
62 }
63 return t
64}
65
66// ContextWithCounterRef adds the given counter to ctx under key specified.
67func ContextWithCounterRef(ctx context.Context, key any, i *int64) context.Context {

Callers 15

TestPbaFunction · 0.92
TestGetNwkSKeysFunction · 0.92
TestGetAppSKeyFunction · 0.92
TestGetHomeNetIDFunction · 0.92
TestDeviceRegistryGetFunction · 0.92
TestDeviceRegistrySetFunction · 0.92
TestDeviceRegistryDeleteFunction · 0.92
TestProcessDownlinkTaskFunction · 0.92
TestDownlinkQueueReplaceFunction · 0.92
TestDownlinkQueuePushFunction · 0.92
TestDownlinkQueueListFunction · 0.92

Calls 1

TFromContextFunction · 0.85

Tested by 15

TestPbaFunction · 0.74
TestGetNwkSKeysFunction · 0.74
TestGetAppSKeyFunction · 0.74
TestGetHomeNetIDFunction · 0.74
TestDeviceRegistryGetFunction · 0.74
TestDeviceRegistrySetFunction · 0.74
TestDeviceRegistryDeleteFunction · 0.74
TestProcessDownlinkTaskFunction · 0.74
TestDownlinkQueueReplaceFunction · 0.74
TestDownlinkQueuePushFunction · 0.74
TestDownlinkQueueListFunction · 0.74