store: make state (de)serialization internal

This hides the state hanlding in the store package. As before, it
can be disabled by passing `nil` instead of the path to the state
file.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-10-05 21:29:55 +02:00 committed by Lars Karlitski
parent ad637b46f8
commit 68ade23fcc
4 changed files with 65 additions and 65 deletions

View file

@ -153,13 +153,13 @@ func TestBasic(t *testing.T) {
}
for _, c := range cases {
api := weldr.New(repo, packages, nil, store.New(nil, nil))
api := weldr.New(repo, packages, nil, store.New(nil))
testRoute(t, api, "GET", c.Path, ``, c.ExpectedStatus, c.ExpectedJSON)
}
}
func TestBlueprints(t *testing.T) {
api := weldr.New(repo, packages, nil, store.New(nil, nil))
api := weldr.New(repo, packages, nil, store.New(nil))
testRoute(t, api, "POST", "/api/v0/blueprints/new",
`{"name":"test","description":"Test","packages":[{"name":"httpd","version":"2.4.*"}],"version":"0.0.0"}`,
@ -182,7 +182,7 @@ func TestBlueprints(t *testing.T) {
}
func TestCompose(t *testing.T) {
api := weldr.New(repo, packages, nil, store.New(nil, nil))
api := weldr.New(repo, packages, nil, store.New(nil))
testRoute(t, api, "POST", "/api/v0/blueprints/new",
`{"name":"test","description":"Test","packages":[{"name":"httpd","version":"2.4.*"}],"version":"0.0.0"}`,