weldr: move common.ComposeState to weldr
ComposeState is only used by the weldr API. Drop the JSON marshaller and unmarshaller, because ComposeState is not used in an JSON-exported field anymore.
This commit is contained in:
parent
669b612d96
commit
bcd57a77e2
5 changed files with 62 additions and 67 deletions
|
|
@ -2,28 +2,26 @@ package common
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestJSONConversions(t *testing.T) {
|
||||
type TestJson struct {
|
||||
Ibs ImageBuildState `json:"ibs"`
|
||||
Cs ComposeState `json:"cs"`
|
||||
}
|
||||
typedCases := []TestJson{
|
||||
{
|
||||
Ibs: IBWaiting,
|
||||
Cs: CWaiting,
|
||||
},
|
||||
{
|
||||
Ibs: IBRunning,
|
||||
Cs: CFailed,
|
||||
},
|
||||
}
|
||||
strCases := []string{
|
||||
`{"ibs": "WAITING", "cs": "WAITING"}`,
|
||||
`{"ibs": "RUNNING", "cs": "FAILED"}`,
|
||||
`{"ibs": "WAITING"}`,
|
||||
`{"ibs": "RUNNING"}`,
|
||||
}
|
||||
|
||||
for n, c := range strCases {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue