~rogpeppe/juju-core/315-api-dialopts

« back to all changes in this revision

Viewing changes to environs/agent/agent_test.go

  • Committer: Roger Peppe
  • Date: 2013-05-25 13:11:46 UTC
  • Revision ID: roger.peppe@canonical.com-20130525131146-knkj6367hnnmapq4
api: add DialOpts to Open

Show diffs side-by-side

added added

removed removed

Lines of Context:
366
366
        st.Close()
367
367
}
368
368
 
 
369
var fastDialOpts = api.DialOpts{}
 
370
 
369
371
func (s *openSuite) TestOpenAPINormal(c *C) {
370
372
        conf := agent.Conf{
371
373
                APIInfo: s.APIInfo(c),
372
374
        }
373
375
        conf.OldPassword = "irrelevant"
374
376
 
375
 
        st, newPassword, err := conf.OpenAPI()
 
377
        st, newPassword, err := conf.OpenAPI(fastDialOpts)
376
378
        c.Assert(err, IsNil)
377
379
        defer st.Close()
378
380
        c.Assert(newPassword, Equals, "")
386
388
        conf.OldPassword = conf.APIInfo.Password
387
389
        conf.APIInfo.Password = "not the right password"
388
390
 
389
 
        st, newPassword, err := conf.OpenAPI()
 
391
        st, newPassword, err := conf.OpenAPI(fastDialOpts)
390
392
        c.Assert(err, IsNil)
391
393
        defer st.Close()
392
394
        c.Assert(newPassword, Matches, ".+")
404
406
        conf.OldPassword = conf.APIInfo.Password
405
407
        conf.APIInfo.Password = ""
406
408
 
407
 
        st, newPassword, err := conf.OpenAPI()
 
409
        st, newPassword, err := conf.OpenAPI(fastDialOpts)
408
410
        c.Assert(err, IsNil)
409
411
        defer st.Close()
410
412
        c.Assert(newPassword, Matches, ".+")