示例#1
0
var _ = Describe("Golifx", func() {
	var (
		client               *Client
		protocolSubscription *common.Subscription
		clientSubscription   *common.Subscription
		timeout              = 200 * time.Millisecond

		mockProtocol *mocks.Protocol
		mockDevice   *mocks.Device
		mockLight    *mocks.Light
		mockLocation *mocks.Location
		mockGroup    *mocks.Group

		deviceID           = uint64(1234)
		deviceUnknownID    = uint64(4321)
		deviceLabel        = `mockDevice`
		deviceUnknownLabel = `unknownDevice`
		lightID            = uint64(5678)
		lightLabel         = `mockLight`

		locationID           = `mockLocationID`
		locationUnknownID    = `unknownLocationID`
		locationLabel        = `mockLocation`
		locationUnknownLabel = `unknownLocation`
		groupID              = `mockGroupID`
		groupUnknownID       = `unknownGroupID`
		groupLabel           = `mockGroup`
		groupUnknownLabel    = `unknownGroup`
	)

	It("should send discovery to the protocol on NewClient", func() {
示例#2
0
文件: client_test.go 项目: pdf/golifx
var _ = Describe("Golifx", func() {
	var (
		client               *Client
		protocolSubscription *common.Subscription
		clientSubscription   *common.Subscription
		timeout              = 500 * time.Millisecond

		mockProtocol *mocks.Protocol
		mockDevice   *mocks.Device
		mockLight    *mocks.Light
		mockLocation *mocks.Location
		mockGroup    *mocks.Group

		deviceID           = uint64(1234)
		deviceUnknownID    = uint64(4321)
		deviceLabel        = `mockDevice`
		deviceUnknownLabel = `unknownDevice`
		lightID            = uint64(5678)
		lightLabel         = `mockLight`

		locationID           = `mockLocationID`
		locationUnknownID    = `unknownLocationID`
		locationLabel        = `mockLocation`
		locationUnknownLabel = `unknownLocation`
		groupID              = `mockGroupID`
		groupUnknownID       = `unknownGroupID`
		groupLabel           = `mockGroup`
		groupUnknownLabel    = `unknownGroup`
	)

	It("should send discovery to the protocol on NewClient", func() {