Move unit tests from tests/unit/ to internal/ following Go conventions: - tests/unit/config/* -> internal/config/* (constants, mode_paths, paths, validation) - tests/unit/container/* -> internal/container/* (podman, security tests) - tests/unit/envpool/* -> internal/envpool/* (envpool tests) - tests/unit/errors/* -> internal/errtypes/* (errors_test.go moved to errtypes package) - tests/unit/experiment/* -> internal/experiment/* (manager tests) - tests/unit/jupyter/* -> internal/jupyter/* (config, package_blacklist, service_manager, trash_restore) Update import paths in test files to reflect new locations. Note: errors_test.go moved from tests/unit/errors/ to internal/errtypes/ to match the package structure.
24 lines
620 B
Go
24 lines
620 B
Go
package jupyter_test
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/jfraeys/fetch_ml/internal/jupyter"
|
|
)
|
|
|
|
func TestGetDefaultServiceConfig_EnvOverridesDefaultImage(t *testing.T) {
|
|
old := os.Getenv("FETCHML_JUPYTER_DEFAULT_IMAGE")
|
|
_ = os.Setenv("FETCHML_JUPYTER_DEFAULT_IMAGE", "quay.io/jupyter/base-notebook:latest")
|
|
t.Cleanup(func() {
|
|
_ = os.Setenv("FETCHML_JUPYTER_DEFAULT_IMAGE", old)
|
|
})
|
|
|
|
cfg := jupyter.GetDefaultServiceConfig()
|
|
if cfg == nil {
|
|
t.Fatalf("expected config")
|
|
}
|
|
if cfg.DefaultImage != "quay.io/jupyter/base-notebook:latest" {
|
|
t.Fatalf("expected overridden image, got %q", cfg.DefaultImage)
|
|
}
|
|
}
|