Skip to content

Commit

Permalink
test: Add some tests to the CreateOrUpdateTranslationsContentType fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
Dobefu committed Dec 28, 2024
1 parent bd78771 commit 27342cd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cmd/cs_sdk/api/create-or-update-translations-content-type_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package api

import (
"os"
"testing"

"github.com/stretchr/testify/assert"
)

func TestCreateOrUpdateTranslationsContentType(t *testing.T) {
var err error

oldApiKey := os.Getenv("CS_API_KEY")
os.Setenv("CS_API_KEY", "bogus")

err = CreateOrUpdateTranslationsContentType()
assert.NotEqual(t, nil, err)

os.Setenv("CS_API_KEY", oldApiKey)

err = CreateOrUpdateTranslationsContentType()
assert.Equal(t, nil, err)
}

0 comments on commit 27342cd

Please sign in to comment.