def test_destroy_volumes(self): self.useFixture(mockpatch.PatchObject(javelin, "client_for_user", return_value=self.fake_client)) self.useFixture(mockpatch.PatchObject(javelin, "_get_volume_by_name", return_value=self.fake_object.volume)) javelin.destroy_volumes([self.fake_object]) mocked_function = self.fake_client.volumes.detach_volume mocked_function.assert_called_once_with(self.fake_object.volume["id"]) mocked_function = self.fake_client.volumes.delete_volume mocked_function.assert_called_once_with(self.fake_object.volume["id"])
def test_destroy_volumes(self): self.useFixture(mockpatch.PatchObject(javelin, "client_for_user", return_value=self.fake_client)) self.useFixture(mockpatch.PatchObject( javelin, "_get_volume_by_name", return_value=self.fake_object.volume)) javelin.destroy_volumes([self.fake_object]) mocked_function = self.fake_client.volumes.detach_volume mocked_function.assert_called_once_with(self.fake_object.volume['id']) mocked_function = self.fake_client.volumes.delete_volume mocked_function.assert_called_once_with(self.fake_object.volume['id'])