Files
sigmasms/flashcall_test.go
Vladimir V Maksimov 85cbc3e940 sms completed
2025-12-03 18:34:25 +03:00

52 lines
874 B
Go

package sigmasms
import (
"log"
"os"
"testing"
"github.com/google/uuid"
)
func loadToken(t *testing.T) string {
data, err := os.ReadFile("./token.test")
if err != nil {
t.Fatalf("test token load error: %v", err)
}
return string(data)
}
func TestFlashCall(t *testing.T) {
token := loadToken(t)
log.Println(token)
}
func TestSMS(t *testing.T) {
token := loadToken(t)
SendSMS(
token,
"+79857770038",
"NG.Market",
"Привет",
)
}
func TestSMSWait(t *testing.T) {
token := loadToken(t)
trID, err := SendSMSWait(token, "+79857770038", "NG.Market", "Привет из Москвы :)")
if err != nil {
t.Fatal(err)
}
t.Log(trID)
}
func TestStatus(t *testing.T) {
token := loadToken(t)
id, _ := uuid.Parse("9987bf00-c082-4dec-b25f-875eb528cf34")
status, err := RequestStatus(id, token)
if err != nil {
t.Fatal(err)
}
t.Log(status)
}