This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 960
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak the PR a little following the docs...
- Loading branch information
1 parent
85b0822
commit 9494bb0
Showing
2 changed files
with
82 additions
and
61 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,21 +38,21 @@ func TestGetErrorTracking(t *testing.T) { | |
}`) | ||
}) | ||
|
||
ET, _, err := client.ErrorTracking.GetErrorTracking(1) | ||
et, _, err := client.ErrorTracking.GetErrorTrackingSettings(1) | ||
if err != nil { | ||
t.Errorf("ErrorTracking.GetErrorTracking returned error: %v", err) | ||
} | ||
|
||
want := &ErrorTracking{ | ||
want := &ErrorTrackingSettings{ | ||
Active: true, | ||
ProjectName: "sample sentry project", | ||
SentryExternalURL: "https://sentry.io/myawesomeproject/project", | ||
APIURL: "https://sentry.io/api/1/projects/myawesomeproject/project", | ||
Integrated: false, | ||
} | ||
|
||
if !reflect.DeepEqual(want, ET) { | ||
t.Errorf("ErrorTracking.GetErrorTracking returned %+v, want %+v", ET, want) | ||
if !reflect.DeepEqual(want, et) { | ||
t.Errorf("ErrorTracking.GetErrorTracking returned %+v, want %+v", et, want) | ||
} | ||
} | ||
|
||
|
@@ -71,21 +71,27 @@ func TestDisableErrorTracking(t *testing.T) { | |
}`) | ||
}) | ||
|
||
ET, _, err := client.ErrorTracking.EnableDisableErrorTracking(1, &ConfigureErrorTrackingOptions{Active: Bool(false), Integrated: Bool(false)}) | ||
et, _, err := client.ErrorTracking.EnableDisableErrorTracking( | ||
1, | ||
&EnableDisableErrorTrackingOptions{ | ||
Active: Bool(false), | ||
Integrated: Bool(false), | ||
}, | ||
) | ||
if err != nil { | ||
t.Errorf("ErrorTracking.EnableDisableErrorTracking returned error: %v", err) | ||
} | ||
|
||
want := &ErrorTracking{ | ||
want := &ErrorTrackingSettings{ | ||
Active: false, | ||
ProjectName: "sample sentry project", | ||
SentryExternalURL: "https://sentry.io/myawesomeproject/project", | ||
APIURL: "https://sentry.io/api/1/projects/myawesomeproject/project", | ||
Integrated: false, | ||
} | ||
|
||
if !reflect.DeepEqual(want, ET) { | ||
t.Errorf("ErrorTracking.EnableDisableErrorTracking returned %+v, want %+v", ET, want) | ||
if !reflect.DeepEqual(want, et) { | ||
t.Errorf("ErrorTracking.EnableDisableErrorTracking returned %+v, want %+v", et, want) | ||
} | ||
} | ||
|
||
|
@@ -105,20 +111,20 @@ func TestListErrorTrackingClientKeys(t *testing.T) { | |
]`) | ||
}) | ||
|
||
CKS, _, err := client.ErrorTracking.ListErrorTrackingClientKeys(1, &ListErrorTrackingClientKeysOptions{Page: 1, PerPage: 10}) | ||
cks, _, err := client.ErrorTracking.ListClientKeys(1, &ListClientKeysOptions{Page: 1, PerPage: 10}) | ||
if err != nil { | ||
t.Errorf("ErrorTracking.ListErrorTrackingClientKeys returned error: %v", err) | ||
} | ||
|
||
want := []*ProjectClientKey{{ | ||
want := []*ErrorTrackingClientKey{{ | ||
ID: 1, | ||
Active: true, | ||
PublicKey: "glet_aa77551d849c083f76d0bc545ed053a3", | ||
SentryDsn: "https://[email protected]/api/v4/error_tracking/collector/5", | ||
}} | ||
|
||
if !reflect.DeepEqual(want, CKS) { | ||
t.Errorf("ErrorTracking.ListErrorTrackingClientKeys returned %+v, want %+v", CKS, want) | ||
if !reflect.DeepEqual(want, cks) { | ||
t.Errorf("ErrorTracking.ListErrorTrackingClientKeys returned %+v, want %+v", cks, want) | ||
} | ||
} | ||
|
||
|
@@ -136,20 +142,20 @@ func TestCreateClientKey(t *testing.T) { | |
}`) | ||
}) | ||
|
||
CK, _, err := client.ErrorTracking.CreateClientKey(1) | ||
ck, _, err := client.ErrorTracking.CreateClientKey(1) | ||
if err != nil { | ||
t.Errorf("ErrorTracking.CreateClientKey returned error: %v", err) | ||
} | ||
|
||
want := &ProjectClientKey{ | ||
want := &ErrorTrackingClientKey{ | ||
ID: 1, | ||
Active: true, | ||
PublicKey: "glet_aa77551d849c083f76d0bc545ed053a3", | ||
SentryDsn: "https://[email protected]/api/v4/error_tracking/collector/5", | ||
} | ||
|
||
if !reflect.DeepEqual(want, CK) { | ||
t.Errorf("ErrorTracking.CreateClientKey returned %+v, want %+v", CK, want) | ||
if !reflect.DeepEqual(want, ck) { | ||
t.Errorf("ErrorTracking.CreateClientKey returned %+v, want %+v", ck, want) | ||
} | ||
} | ||
|
||
|