From 6dc8964dd66cae96922b554e41cc703c68910659 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Wed, 1 Jun 2022 23:40:43 -0500 Subject: [PATCH] WIP tests --- server/cmd/api/api_test.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/server/cmd/api/api_test.go b/server/cmd/api/api_test.go index ec348db..c9b78f4 100644 --- a/server/cmd/api/api_test.go +++ b/server/cmd/api/api_test.go @@ -11,12 +11,26 @@ func TestInstanceInfo(t *testing.T) { name string opts config.Options wantResp *BBJResponse - wantErr HTTPError + wantErr *HTTPError }{} for _, tt := range ts { t.Run(tt.name, func(t *testing.T) { - // TODO + api := &API{ + Opts: config.Options{ + // TODO + }, + User: nil, + } + resp, err := api.InstanceInfo() + if tt.wantErr != nil && err != nil { + t.Errorf("got unwanted error: %s", err.Error()) + return + } + if tt.wantResp != resp { + t.Errorf("wanted %#v got %#v", tt.wantResp, resp) + return + } }) } }