Exemplo n.º 1
0
			},
			"handle2": garden.ContainerMetricsEntry{
				Metrics: garden.Metrics{
					DiskStat: garden.ContainerDiskStat{
						TotalInodesUsed:     5,
						TotalBytesUsed:      6,
						ExclusiveBytesUsed:  7,
						ExclusiveInodesUsed: 8,
					},
				},
			},
		}
		handles := []string{"handle1", "handle2"}

		It("gets info for the requested containers", func() {
			fakeConnection.BulkMetricsReturns(expectedBulkMetrics, nil)

			bulkInfo, err := client.BulkMetrics(handles)
			Ω(err).ShouldNot(HaveOccurred())

			Ω(fakeConnection.BulkMetricsCallCount()).Should(Equal(1))
			Ω(fakeConnection.BulkMetricsArgsForCall(0)).Should(Equal(handles))
			Ω(bulkInfo).Should(Equal(expectedBulkMetrics))
		})

		Context("when there is a error with the connection", func() {
			expectedBulkMetrics := map[string]garden.ContainerMetricsEntry{}

			BeforeEach(func() {
				fakeConnection.BulkMetricsReturns(expectedBulkMetrics, errors.New("Oh noes!"))
			})