Example #1
0
func (*multiplexerSuite) TestRPCObserver_CallsAllObservers(c *gc.C) {
	observers := []*fakeobserver.Instance{
		&fakeobserver.Instance{},
		&fakeobserver.Instance{},
	}

	o := observer.NewMultiplexer(observers[0], observers[1])
	o.RPCObserver()

	for _, f := range observers {
		f.CheckCall(c, 0, "RPCObserver")
	}
}
Example #2
0
func (*multiplexerSuite) TestJoin_CallsAllObservers(c *gc.C) {
	observers := []*fakeobserver.Instance{
		&fakeobserver.Instance{},
		&fakeobserver.Instance{},
	}

	o := observer.NewMultiplexer(observers[0], observers[1])
	var req http.Request
	o.Join(&req, 1234)

	for _, f := range observers {
		f.CheckCall(c, 0, "Join", &req, uint64(1234))
	}
}
Example #3
0
func (*multiplexerSuite) TestLogin_CallsAllObservers(c *gc.C) {
	observers := []*fakeobserver.Instance{
		&fakeobserver.Instance{},
		&fakeobserver.Instance{},
	}

	o := observer.NewMultiplexer(observers[0], observers[1])
	entity := names.NewMachineTag("42")
	model := names.NewModelTag("fake-uuid")
	fromController := false
	userData := "foo"
	o.Login(entity, model, fromController, userData)

	for _, f := range observers {
		f.CheckCall(c, 0, "Login", entity, model, fromController, userData)
	}
}