mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
address review feedback
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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"},
|
||||
|
||||
@@ -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"},
|
||||
|
||||
@@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user