MCPcopy Create free account
hub / github.com/dagger/dagger / TestPipLock

Method TestPipLock

core/integration/module_python_test.go:945–1025  ·  view source on GitHub ↗
(ctx context.Context, t *testctx.T)

Source from the content-addressed store, hash-verified

943}
944
945func (PythonSuite) TestPipLock(ctx context.Context, t *testctx.T) {
946 t.Run("can run existing module", func(ctx context.Context, t *testctx.T) {
947 c := connect(ctx, t)
948
949 out, err := daggerCliBase(t, c).
950 With(pipLockMod(t, c, nil)).
951 With(daggerCall()).
952 Stdout(ctx)
953
954 require.NoError(t, err)
955 require.Equal(t, "Query\n", out)
956 })
957
958 t.Run("no uv.lock on develop", func(ctx context.Context, t *testctx.T) {
959 c := connect(ctx, t)
960
961 _, err := daggerCliBase(t, c).
962 With(pipLockMod(t, c, nil)).
963 With(daggerExec("develop")).
964 WithExec([]string{"test", "!", "-f", "uv.lock"}).
965 With(daggerCall()).
966 Sync(ctx)
967
968 require.NoError(t, err)
969 })
970
971 t.Run("no uv.lock on init", func(ctx context.Context, t *testctx.T) {
972 c := connect(ctx, t)
973
974 _, err := daggerCliBase(t, c).
975 With(pipLockMod(t, c, []string{"pyproject.toml", "requirements.lock"})).
976 With(daggerInitPython()).
977 WithExec([]string{"test", "!", "-f", "uv.lock"}).
978 Sync(ctx)
979
980 require.NoError(t, err)
981 })
982
983 t.Run("no locks on develop", func(ctx context.Context, t *testctx.T) {
984 c := connect(ctx, t)
985
986 _, err := daggerCliBase(t, c).
987 With(pipLockMod(t, c, []string{"**", "!requirements.lock"})).
988 With(daggerExec("develop")).
989 WithExec([]string{"test", "!", "-f", "uv.lock"}).
990 WithExec([]string{"test", "!", "-f", "requirements.lock"}).
991 Sync(ctx)
992
993 require.NoError(t, err)
994 })
995
996 t.Run("does not update pinned dependency", func(ctx context.Context, t *testctx.T) {
997 c := connect(ctx, t)
998
999 out, err := daggerCliBase(t, c).
1000 With(pipLockMod(t, c, nil)).
1001 With(daggerExec("develop")).
1002 With(daggerCall("versions", "--names=platformdirs")).

Callers

nothing calls this directly

Calls 12

daggerCliBaseFunction · 0.85
pipLockModFunction · 0.85
daggerCallFunction · 0.85
daggerExecFunction · 0.85
daggerInitPythonFunction · 0.85
connectFunction · 0.70
RunMethod · 0.65
EqualMethod · 0.65
SyncMethod · 0.65
StdoutMethod · 0.45
WithMethod · 0.45
WithExecMethod · 0.45

Tested by

no test coverage detected