forked from snapcore/snapd
/
storetest.go
110 lines (87 loc) · 3.5 KB
/
storetest.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2014-2018 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package storetest
import (
"context"
"io"
"github.com/snapcore/snapd/asserts"
"github.com/snapcore/snapd/client"
"github.com/snapcore/snapd/overlord/auth"
"github.com/snapcore/snapd/overlord/snapstate"
"github.com/snapcore/snapd/progress"
"github.com/snapcore/snapd/snap"
"github.com/snapcore/snapd/store"
)
// Store implements a snapstate.StoreService where every single method panics.
//
// Embed in your own fakeStore to avoid having to keep up with that interface's
// evolution when it's unrelated to your code.
type Store struct{}
// ensure we conform
var _ snapstate.StoreService = Store{}
func (Store) EnsureDeviceSession() (*auth.DeviceState, error) {
panic("Store.EnsureDeviceSession not expected")
}
func (Store) SnapInfo(context.Context, store.SnapSpec, *auth.UserState) (*snap.Info, error) {
panic("Store.SnapInfo not expected")
}
func (Store) Find(context.Context, *store.Search, *auth.UserState) ([]*snap.Info, error) {
panic("Store.Find not expected")
}
func (Store) SnapAction(context.Context, []*store.CurrentSnap, []*store.SnapAction, store.AssertionQuery, *auth.UserState, *store.RefreshOptions) ([]store.SnapActionResult, []store.AssertionResult, error) {
panic("Store.SnapAction not expected")
}
func (Store) Download(context.Context, string, string, *snap.DownloadInfo, progress.Meter, *auth.UserState, *store.DownloadOptions) error {
panic("Store.Download not expected")
}
func (Store) DownloadStream(ctx context.Context, name string, downloadInfo *snap.DownloadInfo, resume int64, user *auth.UserState) (io.ReadCloser, int, error) {
panic("Store.DownloadStream not expected")
}
func (Store) SuggestedCurrency() string {
panic("Store.SuggestedCurrency not expected")
}
func (Store) Buy(*client.BuyOptions, *auth.UserState) (*client.BuyResult, error) {
panic("Store.Buy not expected")
}
func (Store) ReadyToBuy(*auth.UserState) error {
panic("Store.ReadyToBuy not expected")
}
func (Store) Sections(context.Context, *auth.UserState) ([]string, error) {
panic("Store.Sections not expected")
}
func (Store) Assertion(*asserts.AssertionType, []string, *auth.UserState) (asserts.Assertion, error) {
panic("Store.Assertion not expected")
}
func (Store) DownloadAssertions([]string, *asserts.Batch, *auth.UserState) error {
panic("Store.DownloadAssertions not expected")
}
func (Store) WriteCatalogs(context.Context, io.Writer, store.SnapAdder) error {
panic("fakeStore.WriteCatalogs not expected")
}
func (Store) ConnectivityCheck() (map[string]bool, error) {
panic("ConnectivityCheck not expected")
}
func (Store) CreateCohorts(context.Context, []string) (map[string]string, error) {
panic("CreateCohort not expected")
}
func (Store) LoginUser(username, password, otp string) (string, string, error) {
panic("LoginUser not expected")
}
func (Store) UserInfo(email string) (userinfo *store.User, err error) {
panic("UserInfo not expected")
}