Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePresman committed Dec 8, 2023
1 parent b8faeae commit c0a01d7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/client_new_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,33 @@ func TestClientNewProjectEmptyPackPattern(t *testing.T) {
"c": {content: "c v1"},
})
}

func TestClientNewProjectDuplicateReportsError(t *testing.T) {
tc := util.NewTestCtx(t, auth.Admin, 1)
defer tc.Close()

c, _, close := createTestClient(tc)
defer close()

err := c.NewProject(tc.Context(), 1, nil, nil)
require.NoError(t, err, "NewProject")

/** Create Project Again**/

tcSecond := util.NewTestCtx(t, auth.Admin, 1)
defer tc.Close()

cSecond, _, closeSecond := createTestClient(tc)
defer closeSecond()

errSecond := cSecond.NewProject(tcSecond.Context(), 1, nil, nil)

want := "Project with this id already exists"

if errSecond.Error() != want {
t.Errorf("got %s want %s", errSecond, want)
}

require.NoError(t, err, "NewProject")

Check failure on line 71 in test/client_new_test.go

View workflow job for this annotation

GitHub Actions / golangci

unnecessary trailing newline (whitespace)
}

0 comments on commit c0a01d7

Please sign in to comment.