コード例 #1
0
				Expect(err.Error()).To(ContainSubstring("Failed to checking that virtual guest is pingable"))
				Expect(pingable).To(BeFalse())
			})
		})
	})

	Context("#IsBackendPingeable", func() {
		BeforeEach(func() {
			virtualGuest.Id = 1234567
		})

		Context("when there are no API errors", func() {
			It("checks that the virtual guest instance backend is pigable", func() {
				fakeClient.DoRawHttpRequestResponse = []byte("true")

				pingable, err := virtualGuestService.IsBackendPingable(virtualGuest.Id)
				Expect(err).ToNot(HaveOccurred())
				Expect(pingable).To(BeTrue())
			})

			It("checks that the virtual guest instance backend is NOT pigable", func() {
				fakeClient.DoRawHttpRequestResponse = []byte("false")

				pingable, err := virtualGuestService.IsBackendPingable(virtualGuest.Id)
				Expect(err).ToNot(HaveOccurred())
				Expect(pingable).To(BeFalse())
			})
		})

		Context("when there are API errors", func() {
			It("returns false and error", func() {