mirror of
https://github.com/ManyakRus/telegram_loki.git
synced 2024-12-13 21:42:22 +02:00
36 lines
744 B
Go
36 lines
744 B
Go
package loki
|
|
|
|
import (
|
|
ConfigMain "github.com/ManyakRus/starter/config"
|
|
"github.com/ManyakRus/telegram_loki/internal/config"
|
|
"github.com/golang-module/carbon/v2"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestDownloadJSON(t *testing.T) {
|
|
ConfigMain.LoadEnv()
|
|
config.FillSettings()
|
|
|
|
date2 := time.Now()
|
|
date1 := carbon.Time2Carbon(date2).AddDays(-2).Carbon2Time()
|
|
|
|
Otvet, err := DownloadJSON("sync-service", date1, date2)
|
|
if err != nil {
|
|
t.Error("TestDownloadJSON() error: ", err)
|
|
}
|
|
if (Otvet.Status) == "" {
|
|
t.Error("TestDownloadJSON() error: len(Otvet) =0")
|
|
}
|
|
}
|
|
|
|
func TestAuthentication(t *testing.T) {
|
|
ConfigMain.LoadEnv()
|
|
config.FillSettings()
|
|
|
|
err := Authentication()
|
|
if err != nil {
|
|
t.Error("TestAuthentication() error: ", err)
|
|
}
|
|
}
|