Correção de bugs

master
Leonardo Domingues 2021-11-29 12:11:14 -03:00
parent ee65505e8f
commit e0f1a0ddd4
2 changed files with 8 additions and 11 deletions

View File

@ -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

View File

@ -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")