(ctx context.Context, t *testctx.T)
| 943 | } |
| 944 | |
| 945 | func (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")). |
nothing calls this directly
no test coverage detected