Differentiate between installed and activated states for plugins (#7706)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9c0575ce6e
Коммит
16b845c0d7
31
model/plugins_response_test.go
Обычный файл
31
model/plugins_response_test.go
Обычный файл
@@ -0,0 +1,31 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestPluginsResponseJson(t *testing.T) {
|
||||
manifest := &Manifest{
|
||||
Id: "theid",
|
||||
Backend: &ManifestBackend{
|
||||
Executable: "theexecutable",
|
||||
},
|
||||
Webapp: &ManifestWebapp{
|
||||
BundlePath: "thebundlepath",
|
||||
},
|
||||
}
|
||||
|
||||
response := &PluginsResponse{
|
||||
Active: []*Manifest{manifest},
|
||||
Inactive: []*Manifest{},
|
||||
}
|
||||
|
||||
json := response.ToJson()
|
||||
newResponse := PluginsResponseFromJson(strings.NewReader(json))
|
||||
assert.Equal(t, newResponse, response)
|
||||
assert.Equal(t, newResponse.ToJson(), json)
|
||||
assert.Equal(t, PluginsResponseFromJson(strings.NewReader("junk")), (*PluginsResponse)(nil))
|
||||
}
|
||||
Ссылка в новой задаче
Block a user