Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion sdk/cosmos/azure-cosmos/test/crud_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,15 @@ def test_create_indexing_policy_with_composite_and_spatial_indexes(self):
)
created_properties = created_container.read()
read_indexing_policy = created_properties['indexingPolicy']
self.assertListEqual(indexing_policy['spatialIndexes'], read_indexing_policy['spatialIndexes'])

if 'localhost' in self.host or '127.0.0.1' in self.host: # TODO: Differing result between live and emulator
self.assertListEqual(indexing_policy['spatialIndexes'], read_indexing_policy['spatialIndexes'])
else:
# All types are returned for spatial Indexes
indexing_policy['spatialIndexes'][0]['types'].append('MultiPolygon')
indexing_policy['spatialIndexes'][1]['types'].insert(0, 'Point')
self.assertListEqual(indexing_policy['spatialIndexes'], read_indexing_policy['spatialIndexes'])

self.assertListEqual(indexing_policy['compositeIndexes'], read_indexing_policy['compositeIndexes'])
db.delete_container(container=created_container)

Expand Down Expand Up @@ -1977,6 +1985,11 @@ def _test_create_indexing_policy_with_composite_and_spatial_indexes(self, is_nam
container_definition = {'id': container_id, 'indexingPolicy': indexing_policy}
created_container = self.client.CreateContainer(self.GetDatabaseLink(db, is_name_based), container_definition)
read_indexing_policy = created_container['indexingPolicy']

# All types are returned for spatial Indexes
indexing_policy['spatialIndexes'][0]['types'].append('MultiPolygon')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to remove the 2 disabled tests

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

indexing_policy['spatialIndexes'][1]['types'].insert(0, 'Point')

self.assertListEqual(indexing_policy['spatialIndexes'], read_indexing_policy['spatialIndexes'])
self.assertListEqual(indexing_policy['compositeIndexes'], read_indexing_policy['compositeIndexes'])
self.client.DeleteContainer(created_container['_self'])
Expand Down
5 changes: 1 addition & 4 deletions sdk/cosmos/azure-cosmos/test/query_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,7 @@ def test_max_item_count_honored_in_order_by_query(self):
max_item_count=1,
enable_cross_partition_query=True
)
if 'localhost' in self.host or '127.0.0.1' in self.host: # TODO: Differing result between live and emulator
self.validate_query_requests_count(query_iterable, 15 * 2 + 1)
else:
self.validate_query_requests_count(query_iterable, 17 * 2 + 1)
self.validate_query_requests_count(query_iterable, 15 * 2 + 1)

query_iterable = created_collection.query_items(
query=query,
Expand Down