Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Commit

Permalink
Add list analyzers by type test
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyaglow committed May 25, 2018
1 parent 001f276 commit d7213b5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ func TestListAnalyzers(t *testing.T) {
}
}

func TestListByTypeAnalyzers(t *testing.T) {
client, mux, _, closer := setup()
defer closer()

mux.HandleFunc("/"+analyzersByType+analyzerType, func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write(analyzersJSON)
})

got, _, err := client.Analyzers.ListByType(context.Background(), analyzerType)
if err != nil {
t.Errorf("Analyzer.ListByType returned error: %v", err)
}
if want := wantList; !reflect.DeepEqual(got, want) {
t.Errorf("Analyzer.ListByType = %+v, want %+v", got, want)
}
}

var analyzerType = "ip"

var analyzersJSON = []byte(`
[
{
Expand Down

0 comments on commit d7213b5

Please sign in to comment.