Exemplo n.º 1
0
func (s *connSuite) TestConnectionRemoveInstanceFailed(c *gc.C) {
	failure := errors.New("<unknown>")
	s.FakeConn.Err = failure

	err := google.ConnRemoveInstance(s.Conn, "spam", "a-zone")

	c.Check(errors.Cause(err), gc.Equals, failure)
}
Exemplo n.º 2
0
func (s *connSuite) TestConnectionRemoveInstanceAPI(c *gc.C) {
	err := google.ConnRemoveInstance(s.Conn, "spam", "a-zone")
	c.Assert(err, jc.ErrorIsNil)

	c.Check(s.FakeConn.Calls, gc.HasLen, 2)
	c.Check(s.FakeConn.Calls[0].FuncName, gc.Equals, "RemoveInstance")
	c.Check(s.FakeConn.Calls[0].ProjectID, gc.Equals, "spam")
	c.Check(s.FakeConn.Calls[0].ZoneName, gc.Equals, "a-zone")
	c.Check(s.FakeConn.Calls[0].ID, gc.Equals, "spam")
	c.Check(s.FakeConn.Calls[1].FuncName, gc.Equals, "RemoveFirewall")
	c.Check(s.FakeConn.Calls[1].ProjectID, gc.Equals, "spam")
	c.Check(s.FakeConn.Calls[1].Name, gc.Equals, "spam")
}
Exemplo n.º 3
0
func (s *connSuite) TestConnectionRemoveInstance(c *gc.C) {
	err := google.ConnRemoveInstance(s.Conn, "spam", "a-zone")

	c.Check(err, jc.ErrorIsNil)
}