MCPcopy
hub / github.com/dagger/container-use / TestRepositoryList

Function TestRepositoryList

environment/integration/repository_test.go:58–80  ·  view source on GitHub ↗

TestRepositoryList tests listing all environments

(t *testing.T)

Source from the content-addressed store, hash-verified

56
57// TestRepositoryList tests listing all environments
58func TestRepositoryList(t *testing.T) {
59 t.Parallel()
60 WithRepository(t, "repository-list", SetupEmptyRepo, func(t *testing.T, repo *repository.Repository, user *UserActions) {
61 ctx := context.Background()
62
63 // Create two environments
64 env1 := user.CreateEnvironment("Environment 1", "First test environment")
65 env2 := user.CreateEnvironment("Environment 2", "Second test environment")
66
67 // List should return at least 2
68 envs, err := repo.List(ctx)
69 require.NoError(t, err)
70 assert.GreaterOrEqual(t, len(envs), 2)
71
72 // Verify the environments are in the list
73 var foundIDs []string
74 for _, e := range envs {
75 foundIDs = append(foundIDs, e.ID)
76 }
77 assert.Contains(t, foundIDs, env1.ID)
78 assert.Contains(t, foundIDs, env2.ID)
79 })
80}
81
82// TestRepositoryDelete tests deleting an environment
83func TestRepositoryDelete(t *testing.T) {

Callers

nothing calls this directly

Calls 3

WithRepositoryFunction · 0.85
ListMethod · 0.80
CreateEnvironmentMethod · 0.45

Tested by

no test coverage detected