def test_get_volume_state_absent(self): with mock.patch('requests.get', self.mockRequestsGetDescribeVolumes): self.mockModule.params['volume_id'] = None self.assertEqual( ('absent', None), niftycloud_volume.get_volume_state(self.mockModule))
def test_get_volume_state_error(self): with mock.patch('niftycloud_volume.request_to_api', self.mockRequestsInternalServerError): self.assertEqual( ('absent', None), niftycloud_volume.get_volume_state(self.mockModule))
def test_get_volume_state_present(self): with mock.patch('requests.get', self.mockRequestsGetDescribeVolumes): self.assertEqual( ('attached', 'test001'), niftycloud_volume.get_volume_state(self.mockModule))