forked from toolshed/abra
test: use _test to avoid cyclic imports
This commit is contained in:
@ -1,36 +1,38 @@
|
||||
package config
|
||||
package config_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"coopcloud.tech/abra/pkg/config"
|
||||
)
|
||||
|
||||
func TestNewApp(t *testing.T) {
|
||||
app, err := newApp(expectedAppEnv, appName, expectedAppFile)
|
||||
app, err := config.NewApp(ExpectedAppEnv, AppName, ExpectedAppFile)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(app, expectedApp) {
|
||||
t.Fatalf("did not get expected app type. Expected: %s; Got: %s", app, expectedApp)
|
||||
if !reflect.DeepEqual(app, ExpectedApp) {
|
||||
t.Fatalf("did not get expected app type. Expected: %s; Got: %s", app, ExpectedApp)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadAppEnvFile(t *testing.T) {
|
||||
app, err := readAppEnvFile(expectedAppFile, appName)
|
||||
app, err := config.ReadAppEnvFile(ExpectedAppFile, AppName)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(app, expectedApp) {
|
||||
t.Fatalf("did not get expected app type. Expected: %s; Got: %s", app, expectedApp)
|
||||
if !reflect.DeepEqual(app, ExpectedApp) {
|
||||
t.Fatalf("did not get expected app type. Expected: %s; Got: %s", app, ExpectedApp)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetApp(t *testing.T) {
|
||||
app, err := GetApp(expectedAppFiles, appName)
|
||||
app, err := config.GetApp(ExpectedAppFiles, AppName)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(app, expectedApp) {
|
||||
t.Fatalf("did not get expected app type. Expected: %s; Got: %s", app, expectedApp)
|
||||
if !reflect.DeepEqual(app, ExpectedApp) {
|
||||
t.Fatalf("did not get expected app type. Expected: %s; Got: %s", app, ExpectedApp)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user