~rogpeppe/juju-core/510-errorf-errgo

« back to all changes in this revision

Viewing changes to utils/apt_test.go

  • Committer: Roger Peppe
  • Date: 2014-03-03 12:35:05 UTC
  • Revision ID: roger.peppe@canonical.com-20140303123505-myzkq8hth2hwek8n
Error DeepEquals fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
func (s *AptSuite) TestAptGetError(c *gc.C) {
38
38
        const expected = `E: frobnicator failure detected`
39
39
        cmdError := errors.Newf("error")
40
 
        cmdExpectedError := errors.Newf("apt-get failed: error")
41
40
        cmdChan := s.HookCommandOutput(&utils.AptCommandOutput, []byte(expected), cmdError)
42
41
        err := utils.AptGetInstall("foo")
43
 
        c.Assert(err, gc.DeepEquals, cmdExpectedError)
 
42
        c.Assert(err, gc.ErrorMatches, "apt-get failed: error")
44
43
        cmd := <-cmdChan
45
44
        c.Assert(cmd.Args, gc.DeepEquals, []string{
46
45
                "apt-get", "--option=Dpkg::Options::=--force-confold",
167
166
func (s *AptSuite) TestConfigProxyError(c *gc.C) {
168
167
        const expected = `E: frobnicator failure detected`
169
168
        cmdError := errors.Newf("error")
170
 
        cmdExpectedError := errors.Newf("apt-config failed: error")
171
169
        cmdChan := s.HookCommandOutput(&utils.AptCommandOutput, []byte(expected), cmdError)
172
170
        out, err := utils.AptConfigProxy()
173
 
        c.Assert(err, gc.DeepEquals, cmdExpectedError)
 
171
        c.Assert(err, gc.ErrorMatches, "apt-config failed: error")
174
172
        cmd := <-cmdChan
175
173
        c.Assert(cmd.Args, gc.DeepEquals, []string{
176
174
                "apt-config", "dump", "Acquire::http::Proxy",