Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions model/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func (a *App) ToInfo(version string, downloadSize int64, downloadSha384 string,
SnapID: snapId.Id(),
Name: a.Name,
Summary: a.Summary,
Description: a.Description,
Version: version,
Type: appType,
Architectures: []string{arch},
Expand Down
4 changes: 3 additions & 1 deletion model/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import (
)

func TestApp_ToInfo(t *testing.T) {
app := &App{Name: "name", Summary: "summary"}
app := &App{Name: "name", Summary: "summary", Description: "description"}
info, err := app.ToInfo("1", 0, "sha", "url", "amd64", "icon-url")
assert.NoError(t, err)
assert.Equal(t, "name.1", info.SnapID)
assert.Equal(t, int64(0), info.Download.Size)
assert.Equal(t, "sha", info.Download.Sha3_384)
assert.Equal(t, "url", info.Download.URL)
assert.Equal(t, "app", info.Type)
assert.Equal(t, "summary", info.Summary)
assert.Equal(t, "description", info.Description)
assert.Equal(t, "icon-url", info.Media[0].URL)
}

Expand Down
1 change: 1 addition & 0 deletions model/snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type Snap struct {
SnapID string `json:"snap-id"`
Name string `json:"name"`
Summary string `json:"summary"`
Description string `json:"description"`
Version string `json:"version"`
Type string `json:"type"`
Architectures []string `json:"architectures"`
Expand Down
3 changes: 3 additions & 0 deletions test/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ func TestFind(t *testing.T) {
assert.NoError(t, err, output)
assert.Contains(t, output, "http://apps.s3:3902/v2/apps/stable/testapp1/icon.png",
"snapd find must relay the store's absolute icon URL")
assert.Contains(t, output, "First test application for the integration suite",
"snapd find must relay the store's snap.yaml description")

output, err = Ssh("device", "snap remove testapp1")
assert.NoError(t, err, output)
Expand Down Expand Up @@ -273,6 +275,7 @@ func TestRest_SnapsInfo(t *testing.T) {
assert.Equal(t, 200, resp.StatusCode())
assert.Contains(t, string(resp.Body()), `"snap-id":"testapp1.1"`)
assert.Contains(t, string(resp.Body()), `http://apps.s3:3902/v2/apps/stable/testapp1/icon.png`)
assert.Contains(t, string(resp.Body()), `"description":"First test application for the integration suite"`)
}

func snapArch() (string, error) {
Expand Down