MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestCmdAddProjectCollisionAvoidance

Function TestCmdAddProjectCollisionAvoidance

internal/app/add_test.go:112–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

110}
111
112func TestCmdAddProjectCollisionAvoidance(t *testing.T) {
113 setupFlowRoot(t)
114 wd1 := t.TempDir()
115 wd2 := t.TempDir()
116
117 if rc := cmdAdd([]string{"project", "Same Name", "--work-dir", wd1}); rc != 0 {
118 t.Fatalf("first rc=%d", rc)
119 }
120 if rc := cmdAdd([]string{"project", "Same Name", "--work-dir", wd2}); rc != 0 {
121 t.Fatalf("second rc=%d", rc)
122 }
123 db := openFlowDB(t)
124 if _, err := flowdb.GetProject(db, "same-name"); err != nil {
125 t.Errorf("same-name missing: %v", err)
126 }
127 if _, err := flowdb.GetProject(db, "same-name-2"); err != nil {
128 t.Errorf("same-name-2 missing: %v", err)
129 }
130}
131
132func TestCmdAddProjectBadPriority(t *testing.T) {
133 setupFlowRoot(t)

Callers

nothing calls this directly

Calls 4

GetProjectFunction · 0.92
setupFlowRootFunction · 0.85
cmdAddFunction · 0.85
openFlowDBFunction · 0.85

Tested by

no test coverage detected