コード例 #1
0
func (s *defaultRegionSuite) TestCaseInsensitiveRegionSpecification(c *gc.C) {
	store := jujuclienttesting.NewMemStore()
	store.Credentials["aws"] = jujucloud.CloudCredential{DefaultRegion: "us-east-1"}

	cmd := cloud.NewSetDefaultRegionCommandForTest(store)
	_, err := testing.RunCommand(c, cmd, "aws", "us-WEST-1")
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(store.Credentials["aws"].DefaultRegion, gc.Equals, "us-west-1")
}
コード例 #2
0
func (s *defaultRegionSuite) TestOverwriteDefaultRegion(c *gc.C) {
	store := jujuclienttesting.NewMemStore()
	store.Credentials["aws"] = jujucloud.CloudCredential{DefaultRegion: "us-east-1"}
	cmd := cloud.NewSetDefaultRegionCommandForTest(store)
	s.assertSetDefaultRegion(c, cmd, store, "aws", "")
}
コード例 #3
0
func (s *defaultRegionSuite) TestSetDefaultRegionBuiltIn(c *gc.C) {
	store := jujuclienttesting.NewMemStore()
	cmd := cloud.NewSetDefaultRegionCommandForTest(store)
	// maas has no regions
	s.assertSetDefaultRegion(c, cmd, store, "maas", `cloud maas has no regions`)
}
コード例 #4
0
func (s *defaultRegionSuite) TestSetDefaultRegion(c *gc.C) {
	store := jujuclienttesting.NewMemStore()
	cmd := cloud.NewSetDefaultRegionCommandForTest(store)
	s.assertSetDefaultRegion(c, cmd, store, "aws", "")
}
コード例 #5
0
func (s *defaultRegionSuite) TestSetDefaultRegionBuiltIn(c *gc.C) {
	store := jujuclienttesting.NewMemStore()
	cmd := cloud.NewSetDefaultRegionCommandForTest(store)
	// Cloud 'localhost' is of type lxd.
	s.assertSetCustomDefaultRegion(c, cmd, store, "localhost", "localhost", "")
}