2020-03-16 23:53:28 +01:00
|
|
|
package docker
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/qri-io/starlib/testdata"
|
|
|
|
"go.starlark.net/resolve"
|
|
|
|
"go.starlark.net/starlark"
|
|
|
|
"go.starlark.net/starlarktest"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestImage(t *testing.T) {
|
|
|
|
resolve.AllowFloat = true
|
2020-03-29 11:20:08 +02:00
|
|
|
resolve.AllowLambda = true
|
2020-03-16 23:53:28 +01:00
|
|
|
thread := &starlark.Thread{Load: testdata.NewLoader(LoadModule, ModuleName)}
|
|
|
|
starlarktest.SetReporter(thread, t)
|
|
|
|
|
|
|
|
// Execute test file
|
|
|
|
_, err := starlark.ExecFile(thread, "testdata/test.star", nil, nil)
|
|
|
|
if err != nil {
|
|
|
|
if ee, ok := err.(*starlark.EvalError); ok {
|
|
|
|
t.Error(ee.Backtrace())
|
|
|
|
} else {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|