~rogpeppe/juju-core/438-local-instance-Addresses

« back to all changes in this revision

Viewing changes to environs/tools/urls_test.go

  • Committer: Tarmac
  • Author(s): Roger Peppe, John Arbash Meinel
  • Date: 2013-10-02 12:38:13 UTC
  • mfrom: (1717.1.42 375-dummy-prepare-state-id)
  • Revision ID: tarmac-20131002123813-3tidl1lj00d3a29c
[r=rogpeppe] environs/dummy: add state-id

This makes the dummy provider more like the other
providers in that the Environ does not refer
directly to the bootstrapped state, but is looked
up when operations are performed on it.

This is also a test case for adding attributes at Prepare
time - many tests needed changing to correctly
deal with this.

https://codereview.appspot.com/14207046/

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
        gc "launchpad.net/gocheck"
8
8
 
9
9
        "launchpad.net/juju-core/environs"
 
10
        "launchpad.net/juju-core/environs/config"
10
11
        "launchpad.net/juju-core/environs/configstore"
11
12
        sstesting "launchpad.net/juju-core/environs/simplestreams/testing"
12
13
        "launchpad.net/juju-core/environs/storage"
28
29
 
29
30
func (s *URLsSuite) TearDownTest(c *gc.C) {
30
31
        s.home.Restore()
 
32
        dummy.Reset()
31
33
}
32
34
 
33
35
func (s *URLsSuite) env(c *gc.C, toolsMetadataURL string) environs.Environ {
37
39
                        "tools-url": toolsMetadataURL,
38
40
                })
39
41
        }
40
 
        env, err := environs.NewFromAttrs(attrs)
 
42
        cfg, err := config.New(config.NoDefaults, attrs)
41
43
        c.Assert(err, gc.IsNil)
42
 
        env, err = environs.Prepare(env.Config(), configstore.NewMem())
 
44
        env, err := environs.Prepare(cfg, configstore.NewMem())
43
45
        c.Assert(err, gc.IsNil)
44
46
        return env
45
47
}