Created
April 27, 2020 10:44
-
-
Save plutov/a5f3e60575b05a6e44c239442cd707e8 to your computer and use it in GitHub Desktop.
api-client-7.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +build integration | |
package facest | |
import ( | |
"os" | |
"testing" | |
"github.com/stretchr/testify/assert" | |
) | |
func TestGetFaces(t *testing.T) { | |
c := NewClient(os.Getenv("FACEST_INTEGRATION_API_KEY")) | |
ctx := context.Background() | |
res, err := c.GetFaces(nil) | |
assert.Nil(t, err, "expecting nil error") | |
assert.NotNil(t, res, "expecting non-nil result") | |
assert.Equal(t, 1, res.Count, "expecting 1 face found") | |
assert.Equal(t, 1, res.PagesCount, "expecting 1 PAGE found") | |
assert.Equal(t, "integration_face_id", res.Faces[0].FaceID, "expecting correct face_id") | |
assert.NotEmpty(t, res.Faces[0].FaceToken, "expecting non-empty face_token") | |
assert.Greater(t, len(res.Faces[0].FaceImages), 0, "expecting non-empty face_images") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment