From e0f1a0ddd4ee7febfeb0a33c16dc088e2434b88a Mon Sep 17 00:00:00 2001 From: Leonardo Domingues Date: Mon, 29 Nov 2021 12:11:14 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20de=20bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/dataapi/lib.go | 7 +++---- api/dataapi/lib_test.go | 12 +++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/api/dataapi/lib.go b/api/dataapi/lib.go index 3582853..d1c6bf2 100644 --- a/api/dataapi/lib.go +++ b/api/dataapi/lib.go @@ -1,10 +1,11 @@ package dataapi import ( - "go.digitalcircle.com.br/open/httpcli" - "go.digitalcircle.com.br/open/replaycli-go/api/replay" "strconv" "time" + + "go.digitalcircle.com.br/open/httpcli" + "go.digitalcircle.com.br/open/replaycli-go/api/replay" ) type DataApiOp string @@ -53,8 +54,6 @@ func NewCli() *Cli { } func RegistrarExec(table string, check bool) { - rp := replay.NewCli() - rp.ConfigGet("API_KEY") //Para robôs, age como contador e registra cada repetição no mês c := NewCli() var registros int diff --git a/api/dataapi/lib_test.go b/api/dataapi/lib_test.go index d3ed1bc..eda67b7 100644 --- a/api/dataapi/lib_test.go +++ b/api/dataapi/lib_test.go @@ -2,7 +2,6 @@ package dataapi_test import ( "log" - "os" "strconv" "testing" "time" @@ -11,8 +10,7 @@ import ( ) func TestAPIRetrieve(t *testing.T) { - apikey := os.Getenv("DATAAPI_APIKEY") - c := dataapi.NewCli(apikey) + c := dataapi.NewCli() res, err := c.Do(&dataapi.DataAPIRequest{ Col: "teste3", Op: dataapi.RETRIEVE, @@ -25,7 +23,7 @@ func TestAPIRetrieve(t *testing.T) { } func TestAPIRetrieveWQuery(t *testing.T) { - c := dataapi.NewCli("RnJpIDA1IE5vdiAyMDIxIDExOjE1OjIyIEFNIFVUQwo") + c := dataapi.NewCli() res, err := c.Do(&dataapi.DataAPIRequest{ Col: "C1", Op: dataapi.RETRIEVE, @@ -39,7 +37,7 @@ func TestAPIRetrieveWQuery(t *testing.T) { } func TestAPIUpdate(t *testing.T) { - c := dataapi.NewCli("RnJpIDA1IE5vdiAyMDIxIDExOjE1OjIyIEFNIFVUQwo") + c := dataapi.NewCli() res, err := c.Do(&dataapi.DataAPIRequest{ Col: "C1", Op: dataapi.UPDATE, @@ -56,7 +54,7 @@ func TestAPIUpdate(t *testing.T) { } func TestAPIDelete(t *testing.T) { - c := dataapi.NewCli("RnJpIDA1IE5vdiAyMDIxIDExOjE1OjIyIEFNIFVUQwo") + c := dataapi.NewCli() res, err := c.Do(&dataapi.DataAPIRequest{ Col: "C1", Op: dataapi.DELETE, @@ -74,7 +72,7 @@ func TestAPICreate(t *testing.T) { print("a") print("b") } - c := dataapi.NewCli("RnJpIDA1IE5vdiAyMDIxIDExOjE1OjIyIEFNIFVUQwo") + c := dataapi.NewCli() var registros int var erro int current := time.Now().Format("2006-01")