MCPcopy Index your code
hub / github.com/ddev/ddev / TestGetInactiveProjects

Function TestGetInactiveProjects

pkg/ddevapp/utils_test.go:14–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestGetInactiveProjects(t *testing.T) {
15 assert := asrt.New(t)
16
17 origDir, _ := os.Getwd()
18 app := &ddevapp.DdevApp{}
19
20 site := TestSites[0]
21
22 t.Cleanup(func() {
23 err := os.Chdir(origDir)
24 assert.NoError(err)
25 err = app.Stop(true, false)
26 assert.NoError(err)
27 })
28 // Make sure we have one app in existence
29 err := app.Init(site.Dir)
30 require.NoError(t, err)
31 err = app.Start()
32 require.NoError(t, err)
33
34 // Stop all sites
35 _, err = exec.RunCommand(DdevBin, []string{"stop", "--all"})
36 require.NoError(t, err)
37
38 apps, err := ddevapp.GetInactiveProjects()
39 require.NoError(t, err)
40
41 assert.Greater(len(apps), 0)
42}
43
44func TestExtractProjectNames(t *testing.T) {
45 var apps []*ddevapp.DdevApp

Callers

nothing calls this directly

Calls 7

StopMethod · 0.95
InitMethod · 0.95
StartMethod · 0.95
RunCommandFunction · 0.92
GetInactiveProjectsFunction · 0.92
CleanupMethod · 0.80
ChdirMethod · 0.80

Tested by

no test coverage detected