diff --git a/advisor/backend.go b/advisor/backend.go index 32080f0e6e..444a05254e 100644 --- a/advisor/backend.go +++ b/advisor/backend.go @@ -30,7 +30,7 @@ import ( var ( cmdBucketKey = []byte("Commands") - pkgBucketKey = []byte("Pkgs") + pkgBucketKey = []byte("Snaps") ) type writer struct { @@ -150,8 +150,9 @@ func (t *writer) done(commit bool) error { return e1 } -// Dump returns the whole database as a map. For use in testing and debugging. -func Dump() (map[string][]string, error) { +// DumpCommands returns the whole database as a map. For use in +// testing and debugging. +func DumpCommands() (map[string][]string, error) { db, err := bolt.Open(dirs.SnapCommandsDB, 0600, &bolt.Options{ ReadOnly: true, Timeout: 1 * time.Second, diff --git a/advisor/cmdfinder_test.go b/advisor/cmdfinder_test.go index 3d68013865..da8c1028c1 100644 --- a/advisor/cmdfinder_test.go +++ b/advisor/cmdfinder_test.go @@ -125,8 +125,8 @@ func (s *cmdfinderSuite) TestFindMisspelledCommandMiss(c *C) { c.Check(cmds, HasLen, 0) } -func (s *cmdfinderSuite) TestDump(c *C) { - cmds, err := advisor.Dump() +func (s *cmdfinderSuite) TestDumpCommands(c *C) { + cmds, err := advisor.DumpCommands() c.Assert(err, IsNil) c.Check(cmds, DeepEquals, map[string][]string{ "foo": {"foo"}, diff --git a/overlord/snapstate/catalogrefresh_test.go b/overlord/snapstate/catalogrefresh_test.go index 2abca14fcd..1dd9c906e3 100644 --- a/overlord/snapstate/catalogrefresh_test.go +++ b/overlord/snapstate/catalogrefresh_test.go @@ -99,7 +99,7 @@ func (s *catalogRefreshTestSuite) TestCatalogRefresh(c *C) { c.Check(string(content), Equals, "pkg1\npkg2") c.Check(osutil.FileExists(dirs.SnapCommandsDB), Equals, true) - dump, err := advisor.Dump() + dump, err := advisor.DumpCommands() c.Assert(err, IsNil) c.Check(dump, DeepEquals, map[string][]string{ "foo": {"foo"}, diff --git a/store/store_test.go b/store/store_test.go index 4e2ab68cbd..fcc1dc7043 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -2688,7 +2688,7 @@ const mockNamesJSON = ` "package_name": "foo" } ] -q } + } }` func (t *remoteRepoTestSuite) TestUbuntuStoreSnapCommandsOnClassic(c *C) { @@ -2742,7 +2742,7 @@ func (t *remoteRepoTestSuite) testUbuntuStoreSnapCommands(c *C, onClassic bool) db.Commit() c.Check(bufNames.String(), Equals, "bar\nfoo\n") - dump, err := advisor.Dump() + dump, err := advisor.DumpCommands() c.Assert(err, IsNil) c.Check(dump, DeepEquals, map[string][]string{ "foo": {"foo"},