Skip to content

Commit

Permalink
Add SLO CRUD endpoints
Browse files Browse the repository at this point in the history
update some test files to use the same package for easier dev

TODO: the /v1/slo endpoint does not yet have the status endpoint defined yet, but will be coming in another PR
  • Loading branch information
platinummonkey committed Jul 17, 2019
1 parent dda82d3 commit 6936511
Show file tree
Hide file tree
Showing 17 changed files with 1,396 additions and 42 deletions.
8 changes: 3 additions & 5 deletions api_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
* Copyright 2019 by authors and contributors.
*/

package datadog_test
package datadog

import (
"encoding/json"
"testing"
"time"

"encoding/json"

"github.com/stretchr/testify/assert"
dd "github.com/zorkian/go-datadog-api"
)

func TestAPIKeySerialization(t *testing.T) {
Expand All @@ -28,7 +26,7 @@ func TestAPIKeySerialization(t *testing.T) {
"created": "2019-04-05 09:47:00"
}`

var apikey dd.APIKey
var apikey APIKey
err := json.Unmarshal([]byte(raw), &apikey)
assert.Equal(t, err, nil)
assert.Equal(t, *apikey.Name, "myCoolKey")
Expand Down
12 changes: 5 additions & 7 deletions checks_test.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package datadog_test
package datadog

import (
"testing"

"github.com/zorkian/go-datadog-api"
)

func TestCheckStatus(T *testing.T) {
if datadog.OK != 0 {
if OK != 0 {
T.Error("status OK must be 0 to satisfy Datadog's API")
}
if datadog.WARNING != 1 {
if WARNING != 1 {
T.Error("status WARNING must be 1 to satisfy Datadog's API")
}
if datadog.CRITICAL != 2 {
if CRITICAL != 2 {
T.Error("status CRITICAL must be 2 to satisfy Datadog's API")
}
if datadog.UNKNOWN != 3 {
if UNKNOWN != 3 {
T.Error("status UNKNOWN must be 3 to satisfy Datadog's API")
}
}
Loading

0 comments on commit 6936511

Please sign in to comment.