diff --git a/sdk/cosmos/azure-cosmos/test/crud_tests.py b/sdk/cosmos/azure-cosmos/test/crud_tests.py index 4bb00b7c78de..be096b96594e 100644 --- a/sdk/cosmos/azure-cosmos/test/crud_tests.py +++ b/sdk/cosmos/azure-cosmos/test/crud_tests.py @@ -1908,78 +1908,17 @@ 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']) - self.assertListEqual(indexing_policy['compositeIndexes'], read_indexing_policy['compositeIndexes']) - db.delete_container(container=created_container) - - def disabled_test_create_indexing_policy_with_composite_and_spatial_indexes_self_link(self): - self._test_create_indexing_policy_with_composite_and_spatial_indexes(False) - - def disabled_test_create_indexing_policy_with_composite_and_spatial_indexes_name_based(self): - self._test_create_indexing_policy_with_composite_and_spatial_indexes(True) - def _test_create_indexing_policy_with_composite_and_spatial_indexes(self, is_name_based): - # create database - db = self.databaseForTest - - indexing_policy = { - "spatialIndexes": [ - { - "path": "/path0/*", - "types": [ - "Point", - "LineString", - "Polygon" - ] - }, - { - "path": "/path1/*", - "types": [ - "LineString", - "Polygon", - "MultiPolygon" - ] - } - ], - "compositeIndexes": [ - [ - { - "path": "/path1", - "order": "ascending" - }, - { - "path": "/path2", - "order": "descending" - }, - { - "path": "/path3", - "order": "ascending" - } - ], - [ - { - "path": "/path4", - "order": "ascending" - }, - { - "path": "/path5", - "order": "descending" - }, - { - "path": "/path6", - "order": "ascending" - } - ] - ] - } + 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']) - container_id = 'composite_index_spatial_index' + str(uuid.uuid4()) - 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'] - self.assertListEqual(indexing_policy['spatialIndexes'], read_indexing_policy['spatialIndexes']) self.assertListEqual(indexing_policy['compositeIndexes'], read_indexing_policy['compositeIndexes']) - self.client.DeleteContainer(created_container['_self']) + db.delete_container(container=created_container) def _check_default_indexing_policy_paths(self, indexing_policy): def __get_first(array): diff --git a/sdk/cosmos/azure-cosmos/test/query_tests.py b/sdk/cosmos/azure-cosmos/test/query_tests.py index 8dbe6a01e815..ef4497728981 100644 --- a/sdk/cosmos/azure-cosmos/test/query_tests.py +++ b/sdk/cosmos/azure-cosmos/test/query_tests.py @@ -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,