diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index c6690819aac7..71069a449ed2 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -298,8 +298,7 @@ def _get_next_cb(self, continuation_token, **kwargs): def _extract_data_cb(self, get_next_return): self.location_mode, self._response, self._headers = get_next_return - props_list = [] - props_list = [TableItem(t) for t in self._response.value] + props_list = [TableItem(t, self._headers) for t in self._response.value] return self._headers['x-ms-continuation-NextTableName'] or None, props_list @@ -460,13 +459,23 @@ def service_properties_deserialize(generated): class TableItem(object): """ - Represents an Azure TableItem. Returned by list_tables and query_tables. + Represents an Azure TableItem. Returned by TableServiceClient.list_tables + and TableServiceClient.query_tables. :ivar str name: The name of the table. + :ivar str api_version: The API version included in the service call + :ivar str date: The date the service call was made """ - def __init__(self, table): + def __init__( + self, + table, # type: str + headers=None # type: dict[str,str] + ): + # type: (...) -> None self.table_name = table + self.api_version = headers.pop('version', None) + self.date = headers.pop('date', None) or headers.pop('Date', None) class TablePayloadFormat(object): diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index e5490732c170..47861d843a87 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -32,7 +32,7 @@ from ._serialize import serialize_iso from ._deserialize import _return_headers_and_deserialized from ._error import _process_table_error -from ._models import TableEntityPropertiesPaged, UpdateMode, TableItem +from ._models import TableEntityPropertiesPaged, UpdateMode class TableClient(TableClientBase): diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_models.py index 440baecc21f4..62d0dd6b1047 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_models.py @@ -47,7 +47,7 @@ async def _get_next_cb(self, continuation_token, **kwargs): async def _extract_data_cb(self, get_next_return): self.location_mode, self._response, self._headers = get_next_return - props_list = [TableItem(t) for t in self._response.value] + props_list = [TableItem(t, self._headers) for t in self._response.value] return self._headers['x-ms-continuation-NextTableName'] or None, props_list diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table.yaml index 9081a4a21552..c502962a363a 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:17:59 GMT + - Mon, 31 Aug 2020 18:17:53 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:17:59 GMT + - Mon, 31 Aug 2020 18:17:53 GMT x-ms-version: - '2019-07-07' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:17:59 GMT + - Mon, 31 Aug 2020 18:17:50 GMT location: - https://storagename.table.core.windows.net/Tables('pytablesynca4ed0b50') server: @@ -59,11 +59,11 @@ interactions: Content-Length: - '0' Date: - - Wed, 19 Aug 2020 21:18:00 GMT + - Mon, 31 Aug 2020 18:17:53 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:00 GMT + - Mon, 31 Aug 2020 18:17:53 GMT x-ms-version: - '2019-07-07' method: DELETE @@ -77,7 +77,7 @@ interactions: content-length: - '0' date: - - Wed, 19 Aug 2020 21:17:59 GMT + - Mon, 31 Aug 2020 18:17:51 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table_fail_on_exist.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table_fail_on_exist.yaml index 9915930aa06f..e1f31420cd68 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table_fail_on_exist.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table_fail_on_exist.yaml @@ -15,13 +15,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Thu, 27 Aug 2020 21:28:19 GMT + - Tue, 01 Sep 2020 19:13:20 GMT User-Agent: - - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 27 Aug 2020 21:28:19 GMT + - Tue, 01 Sep 2020 19:13:20 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/Tables response: @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Thu, 27 Aug 2020 21:28:20 GMT + - Tue, 01 Sep 2020 19:13:20 GMT location: - https://storagename.table.core.windows.net/Tables('pytablesync6d7c1113') server: @@ -43,7 +43,7 @@ interactions: x-content-type-options: - nosniff x-ms-version: - - '2019-07-07' + - '2019-02-02' status: code: 201 message: Created @@ -63,26 +63,26 @@ interactions: DataServiceVersion: - '3.0' Date: - - Thu, 27 Aug 2020 21:28:20 GMT + - Tue, 01 Sep 2020 19:13:20 GMT User-Agent: - - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 27 Aug 2020 21:28:20 GMT + - Tue, 01 Sep 2020 19:13:20 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/Tables response: body: string: '{"odata.error":{"code":"TableAlreadyExists","message":{"lang":"en-US","value":"The - table specified already exists.\nRequestId:2e7b208e-d002-003b-7bb8-7c685f000000\nTime:2020-08-27T21:28:21.0100931Z"}}}' + table specified already exists.\nRequestId:f3b2a809-a002-0062-6d93-804425000000\nTime:2020-09-01T19:13:20.4896908Z"}}}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Thu, 27 Aug 2020 21:28:20 GMT + - Tue, 01 Sep 2020 19:13:20 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -90,10 +90,52 @@ interactions: x-content-type-options: - nosniff x-ms-version: - - '2019-07-07' + - '2019-02-02' status: code: 409 message: Conflict +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Tue, 01 Sep 2020 19:13:20 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Sep 2020 19:13:20 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://storagename.table.core.windows.net/Tables?$filter=TableName%20eq%20%27pytablesync6d7c1113%27 + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"pytablesync6d7c1113"}]}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 01 Sep 2020 19:13:20 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK - request: body: null headers: @@ -106,13 +148,13 @@ interactions: Content-Length: - '0' Date: - - Thu, 27 Aug 2020 21:28:20 GMT + - Tue, 01 Sep 2020 19:13:20 GMT User-Agent: - - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 27 Aug 2020 21:28:20 GMT + - Tue, 01 Sep 2020 19:13:20 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: DELETE uri: https://storagename.table.core.windows.net/Tables('pytablesync6d7c1113') response: @@ -124,13 +166,13 @@ interactions: content-length: - '0' date: - - Thu, 27 Aug 2020 21:28:20 GMT + - Tue, 01 Sep 2020 19:13:20 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: - nosniff x-ms-version: - - '2019-07-07' + - '2019-02-02' status: code: 204 message: No Content diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_existing_table.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_existing_table.yaml index 75228025a441..5c6ca2a82553 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_existing_table.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_existing_table.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:00 GMT + - Fri, 28 Aug 2020 15:20:06 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:00 GMT + - Fri, 28 Aug 2020 15:20:06 GMT x-ms-version: - '2019-07-07' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:01 GMT + - Fri, 28 Aug 2020 15:20:07 GMT location: - https://storagename.table.core.windows.net/Tables('pytablesyncded1139b') server: @@ -59,11 +59,11 @@ interactions: Content-Length: - '0' Date: - - Wed, 19 Aug 2020 21:18:01 GMT + - Fri, 28 Aug 2020 15:20:07 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:01 GMT + - Fri, 28 Aug 2020 15:20:07 GMT x-ms-version: - '2019-07-07' method: DELETE @@ -77,7 +77,7 @@ interactions: content-length: - '0' date: - - Wed, 19 Aug 2020 21:18:01 GMT + - Fri, 28 Aug 2020 15:20:07 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: @@ -87,4 +87,46 @@ interactions: status: code: 204 message: No Content +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Fri, 28 Aug 2020 15:20:07 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 28 Aug 2020 15:20:07 GMT + x-ms-version: + - '2019-07-07' + method: GET + uri: https://storagename.table.core.windows.net/Tables?$filter=TableName%20eq%20%27pytablesyncded1139b%27 + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[]}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Fri, 28 Aug 2020 15:20:08 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + status: + code: 200 + message: OK version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables.yaml index 716ea51f12be..9690929e9b5f 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:02 GMT + - Fri, 28 Aug 2020 15:07:23 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:02 GMT + - Fri, 28 Aug 2020 15:07:23 GMT x-ms-version: - '2019-07-07' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:02 GMT + - Fri, 28 Aug 2020 15:07:23 GMT location: - https://storagename.table.core.windows.net/Tables('pytablesynca68e0b85') server: @@ -59,11 +59,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:23 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:23 GMT x-ms-version: - '2019-07-07' method: GET @@ -77,7 +77,49 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:02 GMT + - Fri, 28 Aug 2020 15:07:23 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Fri, 28 Aug 2020 15:07:23 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 28 Aug 2020 15:07:23 GMT + x-ms-version: + - '2019-07-07' + method: GET + uri: https://storagename.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"pytablesynca68e0b85"}]}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Fri, 28 Aug 2020 15:07:23 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -101,11 +143,11 @@ interactions: Content-Length: - '0' Date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:23 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:23 GMT x-ms-version: - '2019-07-07' method: DELETE @@ -119,7 +161,7 @@ interactions: content-length: - '0' date: - - Wed, 19 Aug 2020 21:18:02 GMT + - Fri, 28 Aug 2020 15:07:23 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_filter.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_filter.yaml index 3578acabaf45..f743cf68a19c 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_filter.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_filter.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:24 GMT x-ms-version: - '2019-07-07' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:02 GMT + - Fri, 28 Aug 2020 15:07:24 GMT location: - https://storagename.table.core.windows.net/Tables('pytablesync512a1085') server: @@ -59,11 +59,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:24 GMT x-ms-version: - '2019-07-07' method: GET @@ -77,7 +77,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:02 GMT + - Fri, 28 Aug 2020 15:07:24 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -101,11 +101,11 @@ interactions: Content-Length: - '0' Date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:24 GMT x-ms-version: - '2019-07-07' method: DELETE @@ -119,7 +119,7 @@ interactions: content-length: - '0' date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:25 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_marker.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_marker.yaml index 68db3b3e2bff..4919c7a01141 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_marker.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_marker.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:03 GMT + - Fri, 28 Aug 2020 15:07:24 GMT x-ms-version: - '2019-07-07' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:24 GMT location: - https://storagename.table.core.windows.net/Tables('listtable051291081') server: @@ -63,11 +63,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT x-ms-version: - '2019-07-07' method: POST @@ -81,7 +81,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:24 GMT location: - https://storagename.table.core.windows.net/Tables('listtable151291081') server: @@ -111,11 +111,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT x-ms-version: - '2019-07-07' method: POST @@ -129,7 +129,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:24 GMT location: - https://storagename.table.core.windows.net/Tables('listtable251291081') server: @@ -159,11 +159,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT x-ms-version: - '2019-07-07' method: POST @@ -177,7 +177,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:24 GMT location: - https://storagename.table.core.windows.net/Tables('listtable351291081') server: @@ -203,11 +203,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT x-ms-version: - '2019-07-07' method: GET @@ -221,7 +221,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -229,7 +229,7 @@ interactions: x-content-type-options: - nosniff x-ms-continuation-nexttablename: - - 1!48!bGlzdHRhYmxlMjUxMjkxMDgxATAxZDY3NjZlM2EwMTRhNDg- + - 1!48!bGlzdHRhYmxlMjUxMjkxMDgxATAxZDY3ZDRjZjA2MWNiNzc- x-ms-version: - '2019-07-07' status: @@ -247,15 +247,15 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT x-ms-version: - '2019-07-07' method: GET - uri: https://storagename.table.core.windows.net/Tables?$top=2&NextTableName=1%2148%21bGlzdHRhYmxlMjUxMjkxMDgxATAxZDY3NjZlM2EwMTRhNDg- + uri: https://storagename.table.core.windows.net/Tables?$top=2&NextTableName=1%2148%21bGlzdHRhYmxlMjUxMjkxMDgxATAxZDY3ZDRjZjA2MWNiNzc- response: body: string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable251291081"},{"TableName":"listtable351291081"}]}' @@ -265,7 +265,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 15:07:25 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -273,7 +273,7 @@ interactions: x-content-type-options: - nosniff x-ms-continuation-nexttablename: - - 1!48!cHl0YWJsZXN5bmM1MTJhMTA4NQEwMWQ2NzY2ZTM5OTBlN2M4 + - 1!48!cHl0YWJsZXN5bmM1MTJhMTA4NQEwMWQ2N2Q0Y2VmZTVjZTIz x-ms-version: - '2019-07-07' status: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_num_results.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_num_results.yaml index 89130fffe03f..bffb9a40d305 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_num_results.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_num_results.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 16:44:06 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 16:44:06 GMT x-ms-version: - '2019-07-07' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 16:44:07 GMT location: - https://storagename.table.core.windows.net/Tables('listtable0aab312c0') server: @@ -63,11 +63,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:06 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:06 GMT x-ms-version: - '2019-07-07' method: POST @@ -81,7 +81,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 16:44:07 GMT location: - https://storagename.table.core.windows.net/Tables('listtable1aab312c0') server: @@ -111,11 +111,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:06 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:06 GMT x-ms-version: - '2019-07-07' method: POST @@ -129,7 +129,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 16:44:07 GMT location: - https://storagename.table.core.windows.net/Tables('listtable2aab312c0') server: @@ -159,11 +159,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:07 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:07 GMT x-ms-version: - '2019-07-07' method: POST @@ -177,7 +177,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 16:44:07 GMT location: - https://storagename.table.core.windows.net/Tables('listtable3aab312c0') server: @@ -203,25 +203,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:07 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:07 GMT x-ms-version: - '2019-07-07' method: GET uri: https://storagename.table.core.windows.net/Tables?$top=3 response: body: - string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable051291081"},{"TableName":"listtable0aab312c0"},{"TableName":"listtable151291081"}]}' + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable0aab312c0"},{"TableName":"listtable1aab312c0"},{"TableName":"listtable2aab312c0"}]}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 16:44:07 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -229,7 +229,7 @@ interactions: x-content-type-options: - nosniff x-ms-continuation-nexttablename: - - 1!48!bGlzdHRhYmxlMWFhYjMxMmMwATAxZDY3NjZlM2E2YzdiYWQ- + - 1!48!bGlzdHRhYmxlM2FhYjMxMmMwATAxZDY3ZDVhNzI5MDEzMTI- x-ms-version: - '2019-07-07' status: @@ -247,25 +247,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:07 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:05 GMT + - Fri, 28 Aug 2020 16:44:07 GMT x-ms-version: - '2019-07-07' method: GET uri: https://storagename.table.core.windows.net/Tables response: body: - string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable051291081"},{"TableName":"listtable0aab312c0"},{"TableName":"listtable151291081"},{"TableName":"listtable1aab312c0"},{"TableName":"listtable251291081"},{"TableName":"listtable2aab312c0"},{"TableName":"listtable351291081"},{"TableName":"listtable3aab312c0"}]}' + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable0aab312c0"},{"TableName":"listtable1aab312c0"},{"TableName":"listtable2aab312c0"},{"TableName":"listtable3aab312c0"}]}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 19 Aug 2020 21:18:04 GMT + - Fri, 28 Aug 2020 16:44:07 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table_fail_on_exist.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table_fail_on_exist.yaml index 4ed481a274b2..6f9a7ecc28c2 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table_fail_on_exist.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table_fail_on_exist.yaml @@ -11,13 +11,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:07 GMT + - Mon, 31 Aug 2020 19:51:30 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:07 GMT + - Mon, 31 Aug 2020 19:51:30 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/Tables response: @@ -26,16 +26,16 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:18:07 GMT + date: Mon, 31 Aug 2020 19:51:28 GMT location: https://storagename.table.core.windows.net/Tables('pytableasyncdea11390') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 201 message: Created - url: https://pyacrstorageuwjvfxhidgpv.table.core.windows.net/Tables + url: https://pyacrstoragexy7ydrblpc47.table.core.windows.net/Tables - request: body: '{"TableName": "pytableasyncdea11390"}' headers: @@ -48,42 +48,42 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:08 GMT + - Mon, 31 Aug 2020 19:51:30 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:08 GMT + - Mon, 31 Aug 2020 19:51:30 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/Tables response: body: string: '{"odata.error":{"code":"TableAlreadyExists","message":{"lang":"en-US","value":"The - table specified already exists.\nRequestId:811ea642-1002-001a-1e6e-761e0c000000\nTime:2020-08-19T21:18:08.4179022Z"}}}' + table specified already exists.\nRequestId:bbb52734-c002-0061-23d0-7f9abe000000\nTime:2020-08-31T19:51:28.5285988Z"}}}' headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:18:07 GMT + date: Mon, 31 Aug 2020 19:51:28 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 409 message: Conflict - url: https://pyacrstorageuwjvfxhidgpv.table.core.windows.net/Tables + url: https://pyacrstoragexy7ydrblpc47.table.core.windows.net/Tables - request: body: null headers: Date: - - Wed, 19 Aug 2020 21:18:08 GMT + - Mon, 31 Aug 2020 19:51:30 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:08 GMT + - Mon, 31 Aug 2020 19:51:30 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: DELETE uri: https://storagename.table.core.windows.net/Tables('pytableasyncdea11390') response: @@ -92,12 +92,12 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Wed, 19 Aug 2020 21:18:07 GMT + date: Mon, 31 Aug 2020 19:51:28 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 204 message: No Content - url: https://pyacrstorageuwjvfxhidgpv.table.core.windows.net/Tables('pytableasyncdea11390') + url: https://pyacrstoragexy7ydrblpc47.table.core.windows.net/Tables('pytableasyncdea11390') version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables.yaml index 7097a631c852..7b4099b87b48 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables.yaml @@ -11,13 +11,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:09 GMT + - Mon, 31 Aug 2020 19:07:23 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:09 GMT + - Mon, 31 Aug 2020 19:07:23 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/Tables response: @@ -26,16 +26,16 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:18:09 GMT + date: Mon, 31 Aug 2020 19:07:21 GMT location: https://storagename.table.core.windows.net/Tables('pytableasynce6450d88') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 201 message: Created - url: https://pyacrstorageuwjvfxhidgpv.table.core.windows.net/Tables + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables - request: body: null headers: @@ -44,28 +44,55 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:18:10 GMT + - Mon, 31 Aug 2020 19:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:18:10 GMT + - Mon, 31 Aug 2020 19:07:24 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: GET uri: https://storagename.table.core.windows.net/Tables response: body: - string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable051291081"},{"TableName":"listtable0aab312c0"},{"TableName":"listtable151291081"},{"TableName":"listtable1aab312c0"},{"TableName":"listtable251291081"},{"TableName":"listtable2aab312c0"},{"TableName":"listtable351291081"},{"TableName":"listtable3aab312c0"},{"TableName":"pytableasynce6450d88"}]}' + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"pytableasynce6450d88"}]}' headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:18:09 GMT + date: Mon, 31 Aug 2020 19:07:21 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 200 message: OK - url: https://pyacrstorageuwjvfxhidgpv.table.core.windows.net/Tables + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables +- request: + body: null + headers: + Date: + - Mon, 31 Aug 2020 19:07:24 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 31 Aug 2020 19:07:24 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://storagename.table.core.windows.net/Tables('pytableasynce6450d88') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Mon, 31 Aug 2020 19:07:21 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables('pytableasynce6450d88') version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_num_results.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_num_results.yaml index c74b4adfb695..97117d790312 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_num_results.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_num_results.yaml @@ -11,13 +11,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:28:28 GMT + - Mon, 31 Aug 2020 19:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:28:28 GMT + - Mon, 31 Aug 2020 19:07:24 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/Tables response: @@ -26,16 +26,16 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:28:29 GMT + date: Mon, 31 Aug 2020 19:07:21 GMT location: https://storagename.table.core.windows.net/Tables('listtable0cac14c3') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 201 message: Created - url: https://pyacrstoragedntkilzlolfl.table.core.windows.net/Tables + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables - request: body: '{"TableName": "listtable1cac14c3"}' headers: @@ -48,13 +48,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/Tables response: @@ -63,16 +63,16 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:28:29 GMT + date: Mon, 31 Aug 2020 19:07:21 GMT location: https://storagename.table.core.windows.net/Tables('listtable1cac14c3') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 201 message: Created - url: https://pyacrstoragedntkilzlolfl.table.core.windows.net/Tables + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables - request: body: '{"TableName": "listtable2cac14c3"}' headers: @@ -85,13 +85,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/Tables response: @@ -100,16 +100,16 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:28:29 GMT + date: Mon, 31 Aug 2020 19:07:21 GMT location: https://storagename.table.core.windows.net/Tables('listtable2cac14c3') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 201 message: Created - url: https://pyacrstoragedntkilzlolfl.table.core.windows.net/Tables + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables - request: body: '{"TableName": "listtable3cac14c3"}' headers: @@ -122,13 +122,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/Tables response: @@ -137,16 +137,16 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:28:29 GMT + date: Mon, 31 Aug 2020 19:07:21 GMT location: https://storagename.table.core.windows.net/Tables('listtable3cac14c3') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 201 message: Created - url: https://pyacrstoragedntkilzlolfl.table.core.windows.net/Tables + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables - request: body: null headers: @@ -155,13 +155,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: GET uri: https://storagename.table.core.windows.net/Tables response: @@ -170,15 +170,15 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:28:29 GMT + date: Mon, 31 Aug 2020 19:07:21 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 200 message: OK - url: https://pyacrstoragedntkilzlolfl.table.core.windows.net/Tables + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables - request: body: null headers: @@ -187,13 +187,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: GET uri: https://storagename.table.core.windows.net/Tables?$top=3 response: @@ -202,16 +202,16 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:28:29 GMT + date: Mon, 31 Aug 2020 19:07:21 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-continuation-nexttablename: 1!48!bGlzdHRhYmxlM2NhYzE0YzMBMDFkNjc2NmZhZThlYzM2OQ-- - x-ms-version: '2019-07-07' + x-ms-continuation-nexttablename: 1!48!bGlzdHRhYmxlM2NhYzE0YzMBMDFkNjdmYzlmNDcwZjliOA-- + x-ms-version: '2019-02-02' status: code: 200 message: OK - url: https://pyacrstoragedntkilzlolfl.table.core.windows.net/Tables?$top=3 + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables?$top=3 - request: body: null headers: @@ -220,28 +220,28 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT User-Agent: - - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 19 Aug 2020 21:28:29 GMT + - Mon, 31 Aug 2020 19:07:24 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: GET - uri: https://storagename.table.core.windows.net/Tables?$top=3&NextTableName=1!48!bGlzdHRhYmxlM2NhYzE0YzMBMDFkNjc2NmZhZThlYzM2OQ-- + uri: https://storagename.table.core.windows.net/Tables?$top=3&NextTableName=1!48!bGlzdHRhYmxlM2NhYzE0YzMBMDFkNjdmYzlmNDcwZjliOA-- response: body: string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable3cac14c3"}]}' headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 19 Aug 2020 21:28:29 GMT + date: Mon, 31 Aug 2020 19:07:22 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff - x-ms-version: '2019-07-07' + x-ms-version: '2019-02-02' status: code: 200 message: OK - url: https://pyacrstoragedntkilzlolfl.table.core.windows.net/Tables?$top=3&NextTableName=1!48!bGlzdHRhYmxlM2NhYzE0YzMBMDFkNjc2NmZhZThlYzM2OQ-- + url: https://pyacrstorageelv5bjwcbjip.table.core.windows.net/Tables?$top=3&NextTableName=1!48!bGlzdHRhYmxlM2NhYzE0YzMBMDFkNjdmYzlmNDcwZjliOA-- version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_query_tables_with_num_results.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_query_tables_with_num_results.yaml new file mode 100644 index 000000000000..9f616c307b77 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_query_tables_with_num_results.yaml @@ -0,0 +1,150 @@ +interactions: +- request: + body: '{"TableName": "listtable0235e153d"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '35' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 31 Aug 2020 19:38:33 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 31 Aug 2020 19:38:33 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://storagename.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable0235e153d"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 31 Aug 2020 19:38:30 GMT + location: https://storagename.table.core.windows.net/Tables('listtable0235e153d') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://pyacrstoragef3szz55vphcw.table.core.windows.net/Tables +- request: + body: '{"TableName": "listtable1235e153d"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '35' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 31 Aug 2020 19:38:33 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 31 Aug 2020 19:38:33 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://storagename.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable1235e153d"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 31 Aug 2020 19:38:31 GMT + location: https://storagename.table.core.windows.net/Tables('listtable1235e153d') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://pyacrstoragef3szz55vphcw.table.core.windows.net/Tables +- request: + body: '{"TableName": "listtable2235e153d"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '35' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 31 Aug 2020 19:38:33 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 31 Aug 2020 19:38:33 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://storagename.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable2235e153d"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 31 Aug 2020 19:38:31 GMT + location: https://storagename.table.core.windows.net/Tables('listtable2235e153d') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://pyacrstoragef3szz55vphcw.table.core.windows.net/Tables +- request: + body: '{"TableName": "listtable3235e153d"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '35' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 31 Aug 2020 19:38:33 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b1 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 31 Aug 2020 19:38:33 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://storagename.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable3235e153d"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 31 Aug 2020 19:38:31 GMT + location: https://storagename.table.core.windows.net/Tables('listtable3235e153d') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://pyacrstoragef3szz55vphcw.table.core.windows.net/Tables +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/test_table.py b/sdk/tables/azure-data-tables/tests/test_table.py index e51e1c68651c..06327149fe77 100644 --- a/sdk/tables/azure-data-tables/tests/test_table.py +++ b/sdk/tables/azure-data-tables/tests/test_table.py @@ -9,7 +9,7 @@ import sys import locale import os -from azure.data.tables import TableServiceClient +from azure.data.tables import TableServiceClient, TableItem from datetime import ( datetime, timedelta, @@ -99,7 +99,6 @@ def test_create_properties(self, resource_group, location, storage_account, stor assert created.table_name == table_name properties = ts.get_service_properties() - print(properties) ts.set_service_properties(analytics_logging=TableAnalyticsLogging(write=True)) # have to wait for return to service p = ts.get_service_properties() @@ -108,8 +107,6 @@ def test_create_properties(self, resource_group, location, storage_account, stor retention_policy=RetentionPolicy(enabled=True, days=5))) ps = ts.get_service_properties() - print(ps) - print(p) ts.delete_table(table_name) # @pytest.mark.skip("pending") @@ -140,6 +137,9 @@ def test_create_table_fail_on_exist(self, resource_group, location, storage_acco ts.create_table(table_name) print(created) + name_filter = "TableName eq '{}'".format(table_name) + existing = list(ts.query_tables(filter=name_filter)) + # Assert self.assertIsNotNone(created) ts.delete_table(table_name) @@ -192,39 +192,42 @@ def test_delete_table_invalid_name(self, resource_group, location, storage_accou assert "Table names must be alphanumeric, cannot begin with a number, and must be between 3-63 characters long.""" in str( excinfo) - # @pytest.mark.skip("pending") @GlobalStorageAccountPreparer() - def test_query_tables(self, resource_group, location, storage_account, storage_account_key): + def test_list_tables(self, resource_group, location, storage_account, storage_account_key): # Arrange ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key) - table = self._create_table(ts) + t = self._create_table(ts) # Act tables = list(ts.list_tables()) # Assert + for table_item in tables: + self.assertIsInstance(table_item, TableItem) + self.assertIsNotNone(tables) self.assertGreaterEqual(len(tables), 1) self.assertIsNotNone(tables[0]) - # self.assertNamedItemInContainer(tables, table.table_name) - ts.delete_table(table.table_name) + ts.delete_table(t.table_name) # @pytest.mark.skip("pending") @GlobalStorageAccountPreparer() def test_query_tables_with_filter(self, resource_group, location, storage_account, storage_account_key): # Arrange ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key) - table = self._create_table(ts) + t = self._create_table(ts) # Act - name_filter = "TableName eq '{}'".format(table.table_name) + name_filter = "TableName eq '{}'".format(t.table_name) tables = list(ts.query_tables(filter=name_filter)) + + for table_item in tables: + self.assertIsInstance(table_item, TableItem) + # Assert self.assertIsNotNone(tables) self.assertEqual(len(tables), 1) - # self.assertEqual(tables[0].table_name, [table.table_name]) - # table.delete_table() - ts.delete_table(table.table_name) + ts.delete_table(t.table_name) # @pytest.mark.skip("pending") @GlobalStorageAccountPreparer() @@ -243,8 +246,6 @@ def test_query_tables_with_num_results(self, resource_group, location, storage_a small_page.append(s) for t in next(ts.list_tables().by_page()): big_page.append(t) - # big_page = (next(ts.query_tables().by_page())) - # small_page = (next(ts.query_tables(results_per_page=3).by_page())) # Assert self.assertEqual(len(small_page), 3) @@ -285,13 +286,12 @@ def test_delete_table_with_existing_table(self, resource_group, location, storag table = self._create_table(ts) # Act - # deleted = table.delete_table() deleted = ts.delete_table(table_name=table.table_name) + existing = list(ts.query_tables("TableName eq '{}'".format(table.table_name))) # Assert self.assertIsNone(deleted) - # existing = list(ts.query_tables("TableName eq '{}'".format(table.table_name))) - # self.assertEqual(existing, []) + self.assertEqual(len(existing), 0) # @pytest.mark.skip("pending") @GlobalStorageAccountPreparer() diff --git a/sdk/tables/azure-data-tables/tests/test_table_async.py b/sdk/tables/azure-data-tables/tests/test_table_async.py index 4a3d764de311..47e4475d5e09 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_async.py @@ -7,8 +7,14 @@ from azure.core.exceptions import ResourceNotFoundError, ResourceExistsError, HttpResponseError from _shared.asynctestcase import AsyncTableTestCase from _shared.testcase import GlobalStorageAccountPreparer -from azure.data.tables import AccessPolicy, TableSasPermissions, ResourceTypes, AccountSasPermissions -from azure.data.tables.aio import TableServiceClient +from azure.data.tables import ( + AccessPolicy, + TableSasPermissions, + ResourceTypes, + AccountSasPermissions, + TableItem +) +from azure.data.tables.aio import TableServiceClient, TableClient from azure.data.tables._generated.models import QueryOptions from azure.data.tables._table_shared_access_signature import generate_account_sas @@ -42,6 +48,29 @@ async def _delete_table(self, ts, table): pass # --Test cases for tables -------------------------------------------------- + @pytest.mark.skip("pending") + @GlobalStorageAccountPreparer() + def test_create_properties(self, resource_group, location, storage_account, storage_account_key): + # # Arrange + ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key) + table_name = self._get_table_reference() + # Act + created = ts.create_table(table_name) + + # Assert + assert created.table_name == table_name + + properties = ts.get_service_properties() + ts.set_service_properties(analytics_logging=TableAnalyticsLogging(write=True)) + # have to wait for return to service + p = ts.get_service_properties() + # have to wait for return to service + ts.set_service_properties(minute_metrics= Metrics(enabled=True, include_apis=True, + retention_policy=RetentionPolicy(enabled=True, days=5))) + + ps = ts.get_service_properties() + ts.delete_table(table_name) + # @pytest.mark.skip("pending") @GlobalStorageAccountPreparer() async def test_create_table(self, resource_group, location, storage_account, storage_account_key): @@ -54,7 +83,6 @@ async def test_create_table(self, resource_group, location, storage_account, sto # Assert assert created.table_name == table_name - await ts.delete_table(table_name=table_name) # @pytest.mark.skip("pending") @@ -69,8 +97,13 @@ async def test_create_table_fail_on_exist(self, resource_group, location, storag with self.assertRaises(ResourceExistsError): await ts.create_table(table_name=table_name) + name_filter = "TableName eq '{}'".format(table_name) + existing = ts.query_tables(filter=name_filter) + # Assert - self.assertTrue(created) + self.assertIsInstance(created, TableClient) + # self.assertEqual(len(existing), 1) + # TODO: the AsyncItemPaged does not have a length property, and cannot be used as an iterator await ts.delete_table(table_name=table_name) @GlobalStorageAccountPreparer() @@ -134,9 +167,15 @@ async def test_list_tables(self, resource_group, location, storage_account, stor tables.append(t) # Assert + for table_item in tables: + self.assertIsInstance(table_item, TableItem) + self.assertIsNotNone(table_item.date) + self.assertIsNotNone(table_item.table_name) + self.assertIsNotNone(tables) self.assertGreaterEqual(len(tables), 1) self.assertIsNotNone(tables[0]) + await ts.delete_table(table.table_name) # @pytest.mark.skip("pending") @GlobalStorageAccountPreparer() @@ -154,10 +193,35 @@ async def test_query_tables_with_filter(self, resource_group, location, storage_ # Assert self.assertIsNotNone(tables) self.assertEqual(len(tables), 1) - # self.assertEqual(tables[0].table_name, [table.table_name]) - # table.delete_table() + for table_item in tables: + self.assertIsInstance(table_item, TableItem) + self.assertIsNotNone(table_item.date) + self.assertIsNotNone(table_item.table_name) await ts.delete_table(table.table_name) + @pytest.mark.skip("pending") + # TODO: TablePropertiesPaged is not an iterator, should inherit from AsyncPageIterator + @GlobalStorageAccountPreparer() + async def test_query_tables_with_num_results(self, resource_group, location, storage_account, storage_account_key): + # Arrange + prefix = 'listtable' + ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key) + table_list = [] + for i in range(0, 4): + await self._create_table(ts, prefix + str(i), table_list) + + # Act + small_page = [] + big_page = [] + for s in next(ts.list_tables(results_per_page=3).by_page()): + small_page.append(s) + for t in next(ts.list_tables().by_page()): + big_page.append(t) + + # Assert + self.assertEqual(len(small_page), 3) + self.assertGreaterEqual(len(big_page), 4) + # @pytest.mark.skip("pending") # TODO: the small_page is getting 16, can't figure it out, skipping for now @GlobalStorageAccountPreparer() @@ -191,8 +255,6 @@ async def test_list_tables_with_marker(self, resource_group, location, storage_a for i in range(0, 4): await self._create_table(ts, prefix + str(i), table_names) - # table_names.sort() - # Act generator1 = ts.list_tables(query_options=QueryOptions(top=2)).by_page() tables1 = []