Skip to content

Commit

Permalink
test: Fix test coverage for the CreateContentType function
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed Jan 22, 2025
1 parent 42b59d9 commit 566dbf2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/cli/create-content-type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ func TestCreateContentTypeErrCreate(t *testing.T) {
}

func TestCreateContentTypeErrNoName(t *testing.T) {
err := CreateContentType(true, "", "content_type", true)
tmpfile, cleanup := setupTestCreateContentType(t)
defer cleanup()

_, err := tmpfile.WriteAt([]byte("\n"), 0)
assert.NoError(t, err)

_, err = tmpfile.Seek(0, 0)
assert.NoError(t, err)

err = CreateContentType(true, "", "content_type", true)
assert.Error(t, err)
}

Expand Down

0 comments on commit 566dbf2

Please sign in to comment.