forked from toolshed/abra
.gitea
cli
cmd
pkg
app
catalogue
client
compose
config
app.go
app_test.go
env.go
env_test.go
dns
git
recipe
secret
server
upstream
web
scripts
tests
.drone.yml
.envrc.sample
.gitignore
.goreleaser.yml
Makefile
README.md
go.mod
go.sum
38 lines
868 B
Go
38 lines
868 B
Go
package config
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestNewApp(t *testing.T) {
|
|
app, err := 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)
|
|
}
|
|
}
|
|
|
|
func TestReadAppEnvFile(t *testing.T) {
|
|
app, err := 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)
|
|
}
|
|
}
|
|
|
|
func TestGetApp(t *testing.T) {
|
|
// TODO: Test failures as well as successes
|
|
app, err := 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)
|
|
}
|
|
}
|