Skip to content

Commit

Permalink
Don't iterate over all instances in the project in test_iterate_over_…
Browse files Browse the repository at this point in the history
…instances (#1383)
  • Loading branch information
erlendvollset authored Sep 28, 2023
1 parent 718014f commit bf0de29
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,14 @@ def test_retrieve_non_existent(self, cognite_client: CogniteClient) -> None:
assert cognite_client.data_modeling.instances.retrieve(("myNonExistingSpace", "myImaginaryNode")).nodes == []

def test_iterate_over_instances(self, cognite_client: CogniteClient) -> None:
for nodes in cognite_client.data_modeling.instances(chunk_size=2, limit=-1):
assert isinstance(nodes, NodeList)
assert len(nodes) <= 2
iterator = cognite_client.data_modeling.instances(chunk_size=2)
first_iter = next(iterator)
assert isinstance(first_iter, NodeList)
assert len(first_iter) <= 2

second_iter = next(iterator)
assert isinstance(second_iter, NodeList)
assert len(second_iter) <= 2

def test_apply_invalid_node_data(self, cognite_client: CogniteClient, person_view: View) -> None:
# Arrange
Expand Down

0 comments on commit bf0de29

Please sign in to comment.