Skip to content

Commit

Permalink
removed duplicated lines from daemon/api_test.go's teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
chipaca committed Jan 25, 2017
1 parent fe6d588 commit d505e8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
1 change: 0 additions & 1 deletion client/snap_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"mime/multipart"
"os"
"path/filepath"
"strconv"
)

type SnapOptions struct {
Expand Down
26 changes: 10 additions & 16 deletions daemon/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,46 +177,40 @@ func (s *apiBaseSuite) SetUpTest(c *check.C) {
s.storeSigning = assertstest.NewStoreStack("can0nical", rootPrivKey, storePrivKey)
s.trustedRestorer = sysdb.InjectTrusted(s.storeSigning.Trusted)

assertstateRefreshSnapDeclarations = nil
snapstateCoreInfo = nil
snapstateInstall = nil
snapstateInstallMany = nil
snapstateInstallPath = nil
snapstateRefreshCandidates = nil
snapstateTryPath = nil
snapstateUpdate = nil
snapstateUpdateMany = nil
snapstateInstallMany = nil
snapstateRemoveMany = nil
snapstateRevert = nil
snapstateRevertToRevision = nil
assertstateRefreshSnapDeclarations = nil
snapstateTryPath = nil
snapstateUpdate = nil
snapstateUpdateMany = nil
}

func (s *apiBaseSuite) TearDownTest(c *check.C) {
s.trustedRestorer()
s.d = nil
s.restoreBackends()
snapstateInstall = snapstate.Install
snapstateCoreInfo = snapstate.CoreInfo
snapstateInstallPath = snapstate.InstallPath
assertstateRefreshSnapDeclarations = assertstate.RefreshSnapDeclarations
unsafeReadSnapInfo = unsafeReadSnapInfoImpl
ensureStateSoon = ensureStateSoonImpl
dirs.SetRootDir("")

// TODO: do something mockable
assertstateRefreshSnapDeclarations = assertstate.RefreshSnapDeclarations
snapstateCoreInfo = snapstate.CoreInfo
snapstateInstall = snapstate.Install
snapstateInstallMany = snapstate.InstallMany
snapstateInstallPath = snapstate.InstallPath
snapstateRefreshCandidates = snapstate.RefreshCandidates
snapstateTryPath = snapstate.TryPath
snapstateUpdate = snapstate.Update
snapstateUpdateMany = snapstate.UpdateMany
snapstateInstallMany = snapstate.InstallMany
snapstateRemoveMany = snapstate.RemoveMany
snapstateRevert = snapstate.Revert
snapstateRevertToRevision = snapstate.RevertToRevision

assertstateRefreshSnapDeclarations = assertstate.RefreshSnapDeclarations
snapstateTryPath = snapstate.TryPath
snapstateUpdate = snapstate.Update
snapstateUpdateMany = snapstate.UpdateMany
}

func (s *apiBaseSuite) daemon(c *check.C) *Daemon {
Expand Down

0 comments on commit d505e8a

Please sign in to comment.