add tests to check getting modules from context

This commit is contained in:
Joel Wetzell
2026-03-22 21:00:11 -05:00
parent 13e5d4d85a
commit 70f64e83c7
4 changed files with 172 additions and 26 deletions

View File

@@ -108,11 +108,8 @@ func (m *TestModule) Set(key string, value any) error {
return nil
}
func GetTestContext(ctx context.Context) context.Context {
testModule := &TestModule{}
ctx = context.WithValue(ctx, common.ModulesContextKey, map[string]common.Module{
"test": testModule,
})
func GetContextWithModules(ctx context.Context, modules map[string]common.Module) context.Context {
ctx = context.WithValue(ctx, common.ModulesContextKey, modules)
return ctx
}