mirror of
https://github.com/ManyakRus/starter.git
synced 2025-11-26 23:10:42 +02:00
29 lines
493 B
Go
29 lines
493 B
Go
package config
|
|
|
|
import (
|
|
"github.com/ManyakRus/starter/micro"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestLoadEnv(t *testing.T) {
|
|
//defer recoveryFunction()
|
|
//filename := os.Args[0]
|
|
//dir := filepath.Dir(filename)
|
|
|
|
LoadEnv()
|
|
|
|
//t.Error("Error TestLoadEnv")
|
|
}
|
|
|
|
func TestLoadEnv_from_file(t *testing.T) {
|
|
dir := micro.ProgramDir()
|
|
FileName := dir + "test.sh"
|
|
LoadEnv_from_file(FileName)
|
|
|
|
value := os.Getenv("SERVICE_NAME")
|
|
if value == "" {
|
|
t.Error("TestLoadEnv_from_file() error: value =''")
|
|
}
|
|
}
|