mirror of
https://github.com/Forceu/Gokapi.git
synced 2026-04-29 02:29:42 -05:00
24 lines
491 B
Go
24 lines
491 B
Go
package api
|
|
|
|
import (
|
|
"Gokapi/internal/configuration"
|
|
"Gokapi/internal/test"
|
|
"Gokapi/internal/test/testconfiguration"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
testconfiguration.Create(false)
|
|
configuration.Load()
|
|
exitVal := m.Run()
|
|
testconfiguration.Delete()
|
|
os.Exit(exitVal)
|
|
}
|
|
|
|
func TestIsValidApiKey(t *testing.T) {
|
|
test.IsEqualBool(t, isValidApiKey(""), false)
|
|
test.IsEqualBool(t, isValidApiKey("invalid"), false)
|
|
test.IsEqualBool(t, isValidApiKey("validkey"), true)
|
|
}
|