From 1e42790832dc3f0fd01987a892048711577b56d1 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Thu, 18 Jul 2024 14:27:30 -0400 Subject: [PATCH] Fix unit tests --- pinecone/models/index_list.py | 2 +- tests/unit/models/test_index_list.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pinecone/models/index_list.py b/pinecone/models/index_list.py index 53ed1bb3..6c524489 100644 --- a/pinecone/models/index_list.py +++ b/pinecone/models/index_list.py @@ -12,7 +12,7 @@ def names(self): return [i.name for i in self.indexes] def __getitem__(self, key): - return IndexModel(self.indexes[key]) + return self.indexes[key] def __len__(self): return len(self.indexes) diff --git a/tests/unit/models/test_index_list.py b/tests/unit/models/test_index_list.py index a59610f9..44d36828 100644 --- a/tests/unit/models/test_index_list.py +++ b/tests/unit/models/test_index_list.py @@ -62,9 +62,6 @@ def test_index_list_getitem(self, index_list_response): assert input.indexes[0].dimension == iil[0].dimension assert input.indexes[0].metric == iil[0].metric assert input.indexes[0].host == iil[0].host - - # Deletion protection is a special case, since we're unwrapping - # the value from the DeletionProtection object inside our IndexModel assert input.indexes[0].deletion_protection.value == iil[0].deletion_protection assert iil[0].deletion_protection == "enabled" @@ -72,7 +69,7 @@ def test_index_list_getitem(self, index_list_response): def test_index_list_proxies_methods(self, index_list_response): # Forward compatibility, in case we add more attributes to IndexList for pagination - assert IndexList(index_list_response).index_list.indexes == index_list_response.indexes + assert IndexList(index_list_response).indexes[0].name == index_list_response.indexes[0].name def test_when_results_are_empty(self): iil = IndexList(OpenApiIndexList(indexes=[]))