_, err := hardwareService.GetAttachedNetworkStorages(1234567, "iscsi") Expect(err).To(HaveOccurred()) } }) }) }) Context("#GetAllowedHost", func() { BeforeEach(func() { fakeClient.FakeHttpClient.DoRawHttpRequestResponse, err = testhelpers.ReadJsonTestFixtures("services", "SoftLayer_Hardware_Service_getAllowedHost.json") Expect(err).ToNot(HaveOccurred()) }) It("sucessfully retrieves SoftLayer_Network_Storage_Allowed_Host", func() { _, err := hardwareService.GetAllowedHost(1234567) Expect(err).ToNot(HaveOccurred()) }) Context("when HTTP client returns error codes 40x or 50x", func() { It("fails for error code 40x", func() { errorCodes := []int{400, 401, 499} for _, errorCode := range errorCodes { fakeClient.FakeHttpClient.DoRawHttpRequestInt = errorCode _, err := hardwareService.GetAllowedHost(1234567) Expect(err).To(HaveOccurred()) } }) It("fails for error code 50x", func() {