MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/buildpacks / TestAdaptEntrypoint_Windows

Function TestAdaptEntrypoint_Windows

pkg/python/python_test.go:659–690  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

657 }
658}
659
660func TestAdaptEntrypoint_Windows(t *testing.T) {
661 testCases := []struct {
662 name string
663 cmd []string
664 scriptCmd []string
665 want []string
666 }{
667 {
668 name: "gunicorn_windows",
669 cmd: []string{"gunicorn", "-b", ":8080", "main:app"},
670 want: []string{"python", "lib\\bin\\gunicorn", "-b", ":8080", "main:app"},
671 },
672 {
673 name: "uvicorn_windows",
674 cmd: []string{"uvicorn", "main:app", "--port", "8080", "--host", "0.0.0.0"},
675 want: []string{"python", "lib\\bin\\uvicorn", "main:app", "--port", "8080", "--host", "0.0.0.0"},
676 },
677 }
678
679 for _, tc := range testCases {
680 t.Run(tc.name, func(t *testing.T) {
681 ctx := gcp.NewContext(gcp.WithCapability(EntrypointAdapterCapability, &MakerEntrypointAdapter{TargetPlatform: "windows/amd64"}))
682 got, err := AdaptEntrypoint(ctx, tc.cmd, tc.scriptCmd)
683 if err != nil {
684 t.Fatalf("AdaptEntrypoint(%v) failed: %v", tc.cmd, err)
685 }
686 if diff := cmp.Diff(tc.want, got); diff != "" {
687 t.Errorf("AdaptEntrypoint(%v) returned diff (-want +got):\n%s", tc.cmd, diff)
688 }
689 })
690 }
691}
692
693func TestCommand(t *testing.T) {

Callers

nothing calls this directly

Calls 1

AdaptEntrypointFunction · 0.85

Tested by

no test coverage detected