31 lines
622 B
Go
31 lines
622 B
Go
package workflow
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"cloud.o-forge.io/core/oc-lib/models/utils"
|
|
"cloud.o-forge.io/core/oc-lib/tools"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestStoreOneWorkflow(t *testing.T) {
|
|
w := Workflow{
|
|
AbstractObject: utils.AbstractObject{Name: "testWorkflow"},
|
|
}
|
|
|
|
wma := New(tools.WORKFLOW, "", "", nil, nil)
|
|
id, _, _ := wma.StoreOne(&w)
|
|
|
|
assert.NotEmpty(t, id)
|
|
}
|
|
|
|
func TestLoadOneWorkflow(t *testing.T) {
|
|
w := Workflow{
|
|
AbstractObject: utils.AbstractObject{Name: "testWorkflow"},
|
|
}
|
|
|
|
wma := New(tools.WORKFLOW, "", "", nil, nil)
|
|
new_w, _, _ := wma.StoreOne(&w)
|
|
assert.Equal(t, w, new_w)
|
|
}
|