~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/apiserver/imagemetadata/updatefrompublished_test.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
        "github.com/juju/juju/cmd/modelcmd"
16
16
        "github.com/juju/juju/environs"
17
17
        "github.com/juju/juju/environs/config"
18
 
        "github.com/juju/juju/environs/configstore"
19
18
        "github.com/juju/juju/environs/imagemetadata"
20
19
        imagetesting "github.com/juju/juju/environs/imagemetadata/testing"
21
20
        "github.com/juju/juju/environs/simplestreams"
164
163
        // testingEnvConfig prepares an environment configuration using
165
164
        // the dummy provider since it doesn't implement simplestreams.HasRegion.
166
165
        s.state.environConfig = func() (*config.Config, error) {
167
 
                cfg, err := config.New(config.NoDefaults, dummy.SampleConfig())
168
 
                c.Assert(err, jc.ErrorIsNil)
169
166
                env, err := environs.Prepare(
170
 
                        modelcmd.BootstrapContext(testing.Context(c)), configstore.NewMem(),
 
167
                        modelcmd.BootstrapContext(testing.Context(c)),
171
168
                        jujuclienttesting.NewMemStore(),
172
 
                        "dummycontroller", environs.PrepareForBootstrapParams{Config: cfg},
 
169
                        environs.PrepareParams{
 
170
                                ControllerName: "dummycontroller",
 
171
                                BaseConfig:     dummy.SampleConfig(),
 
172
                                CloudName:      "dummy",
 
173
                        },
173
174
                )
174
175
                c.Assert(err, jc.ErrorIsNil)
175
176
                return env.Config(), err
221
222
        environs.EnvironProvider
222
223
}
223
224
 
224
 
func (p mockEnvironProvider) PrepareForBootstrap(environs.BootstrapContext, environs.PrepareForBootstrapParams) (environs.Environ, error) {
 
225
func (p mockEnvironProvider) BootstrapConfig(args environs.BootstrapConfigParams) (*config.Config, error) {
 
226
        return args.Config, nil
 
227
}
 
228
 
 
229
func (p mockEnvironProvider) PrepareForBootstrap(environs.BootstrapContext, *config.Config) (environs.Environ, error) {
225
230
        return &mockEnviron{}, nil
226
231
}
227
232