diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py b/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py index 56e7cae7598d..da433b76da5c 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py @@ -42,6 +42,8 @@ def _get_match_headers(kwargs, match_param, etag_param): raise ValueError("'{}' specified without '{}'.".format(match_param, etag_param)) elif match_condition == MatchConditions.IfMissing: if_none_match = '*' + elif match_condition == MatchConditions.Unconditionally: + if_none_match = '*' elif match_condition is None: if kwargs.get(etag_param): raise ValueError("'{}' specified without '{}'.".format(etag_param, match_param)) 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 47861d843a87..3d000497dd3b 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 @@ -239,6 +239,7 @@ def delete_entity( if_match, _ = _get_match_headers(kwargs=dict(kwargs, etag=kwargs.pop('etag', None), match_condition=kwargs.pop('match_condition', None)), etag_param='etag', match_param='match_condition') + try: self._client.table.delete_entity( table=self.table_name, diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match.yaml index c241de9b79d2..a96610441e25 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match.yaml @@ -191,6 +191,49 @@ 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: + - Tue, 25 Aug 2020 15:09:34 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:34 GMT + x-ms-version: + - '2019-07-07' + method: GET + uri: https://storagename.table.core.windows.net/uttable74691147(PartitionKey='pk74691147',RowKey='rk74691147') + response: + body: + string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The + specified resource does not exist.\nRequestId:32d896fc-f002-0081-26f1-7abf70000000\nTime:2020-08-25T15:09:35.2385928Z"}}}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:34 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: 404 + message: Not Found - request: body: null headers: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_missing.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_missing.yaml new file mode 100644 index 000000000000..823055a08c42 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_missing.yaml @@ -0,0 +1,421 @@ +interactions: +- request: + body: '{"TableName": "uttableda214a0"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '31' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:34 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:34 GMT + x-ms-version: + - '2019-07-07' + 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":"uttableda214a0"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:34 GMT + location: + - https://storagename.table.core.windows.net/Tables('uttableda214a0') + 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: 201 + message: Created +- request: + body: '{"PartitionKey": "pkda214a0", "RowKey": "rkda214a0", "age": "39", "age@odata.type": + "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1, + "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday": + "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '535' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:35 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:35 GMT + x-ms-version: + - '2019-07-07' + method: POST + uri: https://storagename.table.core.windows.net/uttableda214a0 + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableda214a0/@Element","odata.etag":"W/\"datetime''2020-08-25T15%3A09%3A35.7851013Z''\"","PartitionKey":"pkda214a0","RowKey":"rkda214a0","Timestamp":"2020-08-25T15:09:35.7851013Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:35 GMT + etag: + - W/"datetime'2020-08-25T15%3A09%3A35.7851013Z'" + location: + - https://storagename.table.core.windows.net/uttableda214a0(PartitionKey='pkda214a0',RowKey='rkda214a0') + 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: 201 + message: Created +- request: + body: '{"TableName": "querytableda214a0"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '34' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:35 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:35 GMT + x-ms-version: + - '2019-07-07' + 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":"querytableda214a0"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:35 GMT + location: + - https://storagename.table.core.windows.net/Tables('querytableda214a0') + 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: 201 + message: Created +- request: + body: '{"PartitionKey": "pkda214a0", "RowKey": "rkda214a01", "age": "39", "age@odata.type": + "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1, + "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday": + "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '536' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:35 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:35 GMT + x-ms-version: + - '2019-07-07' + method: POST + uri: https://storagename.table.core.windows.net/querytableda214a0 + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytableda214a0/@Element","odata.etag":"W/\"datetime''2020-08-25T15%3A09%3A35.9802405Z''\"","PartitionKey":"pkda214a0","RowKey":"rkda214a01","Timestamp":"2020-08-25T15:09:35.9802405Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:35 GMT + etag: + - W/"datetime'2020-08-25T15%3A09%3A35.9802405Z'" + location: + - https://storagename.table.core.windows.net/querytableda214a0(PartitionKey='pkda214a0',RowKey='rkda214a01') + 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: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:35 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:35 GMT + x-ms-version: + - '2019-07-07' + method: GET + uri: https://storagename.table.core.windows.net/uttableda214a0(PartitionKey='pkda214a0',RowKey='rkda214a0') + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableda214a0/@Element","odata.etag":"W/\"datetime''2020-08-25T15%3A09%3A35.7851013Z''\"","PartitionKey":"pkda214a0","RowKey":"rkda214a0","Timestamp":"2020-08-25T15:09:35.7851013Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:35 GMT + etag: + - W/"datetime'2020-08-25T15%3A09%3A35.7851013Z'" + 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:35 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:35 GMT + x-ms-version: + - '2019-07-07' + method: DELETE + uri: https://storagename.table.core.windows.net/uttableda214a0(PartitionKey='pkda214a0',RowKey='rkda214a0') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 25 Aug 2020 15:09:35 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + 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: + - Tue, 25 Aug 2020 15:09:35 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:35 GMT + x-ms-version: + - '2019-07-07' + method: GET + uri: https://storagename.table.core.windows.net/uttableda214a0(PartitionKey='pkda214a0',RowKey='rkda214a0') + response: + body: + string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The + specified resource does not exist.\nRequestId:ee49fcb0-5002-0098-5ef1-7a3fcb000000\nTime:2020-08-25T15:09:36.2554367Z"}}}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:35 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: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 25 Aug 2020 15:09:35 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:35 GMT + x-ms-version: + - '2019-07-07' + method: DELETE + uri: https://storagename.table.core.windows.net/Tables('uttableda214a0') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 25 Aug 2020 15:09:35 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 25 Aug 2020 15:09:35 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:35 GMT + x-ms-version: + - '2019-07-07' + method: DELETE + uri: https://storagename.table.core.windows.net/Tables('querytableda214a0') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 25 Aug 2020 15:09:35 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_modified.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_modified.yaml index 428463ea5c78..ef0065d2926e 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_modified.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_modified.yaml @@ -15,13 +15,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Thu, 20 Aug 2020 15:55:21 GMT + - Tue, 01 Sep 2020 22:29:24 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, 20 Aug 2020 15:55:21 GMT + - Tue, 01 Sep 2020 22:29:24 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, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:24 GMT location: - https://storagename.table.core.windows.net/Tables('uttable222514e7') server: @@ -43,18 +43,17 @@ interactions: x-content-type-options: - nosniff x-ms-version: - - '2019-07-07' + - '2019-02-02' status: code: 201 message: Created - request: - body: '{"PartitionKey": "pk222514e7", "RowKey": "rk222514e7", "age": "39", "age@odata.type": - "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1, - "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday": - "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", - "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": - "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", - "clsid@odata.type": "Edm.Guid"}' + body: '{"PartitionKey": "pk222514e7", "RowKey": "rk222514e7", "age": 39, "sex": + "male", "married": true, "deceased": false, "ratio": 3.1, "evenratio": 3.0, + "large": 933311100, "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": + "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", + "binary": "YmluYXJ5", "binary@odata.type": "Edm.Binary", "other": 20, "clsid": + "c9da6455-213d-42c9-9a79-3e9149a57833", "clsid@odata.type": "Edm.Guid"}' headers: Accept: - application/json;odata=minimalmetadata @@ -63,33 +62,33 @@ interactions: Connection: - keep-alive Content-Length: - - '537' + - '469' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 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, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: POST uri: https://storagename.table.core.windows.net/uttable222514e7 response: body: - string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable222514e7/@Element","odata.etag":"W/\"datetime''2020-08-20T15%3A55%3A22.2442174Z''\"","PartitionKey":"pk222514e7","RowKey":"rk222514e7","Timestamp":"2020-08-20T15:55:22.2442174Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable222514e7/@Element","odata.etag":"W/\"datetime''2020-09-01T22%3A29%3A25.4368824Z''\"","PartitionKey":"pk222514e7","RowKey":"rk222514e7","Timestamp":"2020-09-01T22:29:25.4368824Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:24 GMT etag: - - W/"datetime'2020-08-20T15%3A55%3A22.2442174Z'" + - W/"datetime'2020-09-01T22%3A29%3A25.4368824Z'" location: - https://storagename.table.core.windows.net/uttable222514e7(PartitionKey='pk222514e7',RowKey='rk222514e7') server: @@ -99,7 +98,110 @@ interactions: x-content-type-options: - nosniff x-ms-version: - - '2019-07-07' + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: '{"TableName": "querytable222514e7"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '35' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 01 Sep 2020 22:29:25 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 22:29:25 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":"querytable222514e7"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 01 Sep 2020 22:29:24 GMT + location: + - https://storagename.table.core.windows.net/Tables('querytable222514e7') + 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 +- request: + body: '{"PartitionKey": "pk222514e7", "RowKey": "rk222514e71", "age": 39, "sex": + "male", "married": true, "deceased": false, "ratio": 3.1, "evenratio": 3.0, + "large": 933311100, "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": + "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", + "binary": "YmluYXJ5", "binary@odata.type": "Edm.Binary", "other": 20, "clsid": + "c9da6455-213d-42c9-9a79-3e9149a57833", "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '470' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 01 Sep 2020 22:29:25 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 22:29:25 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://storagename.table.core.windows.net/querytable222514e7 + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable222514e7/@Element","odata.etag":"W/\"datetime''2020-09-01T22%3A29%3A25.5729769Z''\"","PartitionKey":"pk222514e7","RowKey":"rk222514e71","Timestamp":"2020-09-01T22:29:25.5729769Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 01 Sep 2020 22:29:24 GMT + etag: + - W/"datetime'2020-09-01T22%3A29%3A25.5729769Z'" + location: + - https://storagename.table.core.windows.net/querytable222514e7(PartitionKey='pk222514e7',RowKey='rk222514e71') + 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 @@ -115,27 +217,27 @@ interactions: DataServiceVersion: - '3.0' Date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 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, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: GET uri: https://storagename.table.core.windows.net/uttable222514e7(PartitionKey='pk222514e7',RowKey='rk222514e7') response: body: - string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable222514e7/@Element","odata.etag":"W/\"datetime''2020-08-20T15%3A55%3A22.2442174Z''\"","PartitionKey":"pk222514e7","RowKey":"rk222514e7","Timestamp":"2020-08-20T15:55:22.2442174Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable222514e7/@Element","odata.etag":"W/\"datetime''2020-09-01T22%3A29%3A25.4368824Z''\"","PartitionKey":"pk222514e7","RowKey":"rk222514e7","Timestamp":"2020-09-01T22:29:25.4368824Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:24 GMT etag: - - W/"datetime'2020-08-20T15%3A55%3A22.2442174Z'" + - W/"datetime'2020-09-01T22%3A29%3A25.4368824Z'" server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -143,7 +245,7 @@ interactions: x-content-type-options: - nosniff x-ms-version: - - '2019-07-07' + - '2019-02-02' status: code: 200 message: OK @@ -161,15 +263,15 @@ interactions: DataServiceVersion: - '3.0' Date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 GMT If-Match: - - W/"datetime'2020-08-20T15%3A55%3A22.2442174Z'" + - '*' 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, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: DELETE uri: https://storagename.table.core.windows.net/uttable222514e7(PartitionKey='pk222514e7',RowKey='rk222514e7') response: @@ -181,13 +283,13 @@ interactions: content-length: - '0' date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 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 @@ -203,26 +305,26 @@ interactions: DataServiceVersion: - '3.0' Date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 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, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: GET uri: https://storagename.table.core.windows.net/uttable222514e7(PartitionKey='pk222514e7',RowKey='rk222514e7') response: body: string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The - specified resource does not exist.\nRequestId:ab4de76a-c002-0099-070a-7725de000000\nTime:2020-08-20T15:55:22.4983994Z"}}}' + specified resource does not exist.\nRequestId:d502509e-1002-0051-1daf-8076f2000000\nTime:2020-09-01T22:29:25.7781197Z"}}}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -230,7 +332,7 @@ interactions: x-content-type-options: - nosniff x-ms-version: - - '2019-07-07' + - '2019-02-02' status: code: 404 message: Not Found @@ -246,13 +348,13 @@ interactions: Content-Length: - '0' Date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 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, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 GMT x-ms-version: - - '2019-07-07' + - '2019-02-02' method: DELETE uri: https://storagename.table.core.windows.net/Tables('uttable222514e7') response: @@ -264,13 +366,53 @@ interactions: content-length: - '0' date: - - Thu, 20 Aug 2020 15:55:22 GMT + - Tue, 01 Sep 2020 22:29:25 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 +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 01 Sep 2020 22:29:25 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 22:29:25 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://storagename.table.core.windows.net/Tables('querytable222514e7') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 01 Sep 2020 22:29:25 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_entity.test_get_entity_if_match_present.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_present.yaml new file mode 100644 index 000000000000..261086b5cfcc --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_present.yaml @@ -0,0 +1,421 @@ +interactions: +- request: + body: '{"TableName": "uttableda814a7"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '31' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:37 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:37 GMT + x-ms-version: + - '2019-07-07' + 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":"uttableda814a7"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:37 GMT + location: + - https://storagename.table.core.windows.net/Tables('uttableda814a7') + 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: 201 + message: Created +- request: + body: '{"PartitionKey": "pkda814a7", "RowKey": "rkda814a7", "age": "39", "age@odata.type": + "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1, + "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday": + "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '535' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:37 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:37 GMT + x-ms-version: + - '2019-07-07' + method: POST + uri: https://storagename.table.core.windows.net/uttableda814a7 + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableda814a7/@Element","odata.etag":"W/\"datetime''2020-08-25T15%3A09%3A37.9811678Z''\"","PartitionKey":"pkda814a7","RowKey":"rkda814a7","Timestamp":"2020-08-25T15:09:37.9811678Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:37 GMT + etag: + - W/"datetime'2020-08-25T15%3A09%3A37.9811678Z'" + location: + - https://storagename.table.core.windows.net/uttableda814a7(PartitionKey='pkda814a7',RowKey='rkda814a7') + 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: 201 + message: Created +- request: + body: '{"TableName": "querytableda814a7"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '34' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:37 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:37 GMT + x-ms-version: + - '2019-07-07' + 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":"querytableda814a7"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:37 GMT + location: + - https://storagename.table.core.windows.net/Tables('querytableda814a7') + 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: 201 + message: Created +- request: + body: '{"PartitionKey": "pkda814a7", "RowKey": "rkda814a71", "age": "39", "age@odata.type": + "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1, + "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday": + "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '536' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:37 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:37 GMT + x-ms-version: + - '2019-07-07' + method: POST + uri: https://storagename.table.core.windows.net/querytableda814a7 + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytableda814a7/@Element","odata.etag":"W/\"datetime''2020-08-25T15%3A09%3A38.1492804Z''\"","PartitionKey":"pkda814a7","RowKey":"rkda814a71","Timestamp":"2020-08-25T15:09:38.1492804Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:37 GMT + etag: + - W/"datetime'2020-08-25T15%3A09%3A38.1492804Z'" + location: + - https://storagename.table.core.windows.net/querytableda814a7(PartitionKey='pkda814a7',RowKey='rkda814a71') + 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: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:37 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:37 GMT + x-ms-version: + - '2019-07-07' + method: GET + uri: https://storagename.table.core.windows.net/uttableda814a7(PartitionKey='pkda814a7',RowKey='rkda814a7') + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableda814a7/@Element","odata.etag":"W/\"datetime''2020-08-25T15%3A09%3A37.9811678Z''\"","PartitionKey":"pkda814a7","RowKey":"rkda814a7","Timestamp":"2020-08-25T15:09:37.9811678Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:37 GMT + etag: + - W/"datetime'2020-08-25T15%3A09%3A37.9811678Z'" + 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:37 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:37 GMT + x-ms-version: + - '2019-07-07' + method: DELETE + uri: https://storagename.table.core.windows.net/uttableda814a7(PartitionKey='pkda814a7',RowKey='rkda814a7') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 25 Aug 2020 15:09:37 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + 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: + - Tue, 25 Aug 2020 15:09:37 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:37 GMT + x-ms-version: + - '2019-07-07' + method: GET + uri: https://storagename.table.core.windows.net/uttableda814a7(PartitionKey='pkda814a7',RowKey='rkda814a7') + response: + body: + string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The + specified resource does not exist.\nRequestId:2ebf12d5-9002-00a8-76f1-7a8104000000\nTime:2020-08-25T15:09:38.4114556Z"}}}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:37 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: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 25 Aug 2020 15:09:37 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:37 GMT + x-ms-version: + - '2019-07-07' + method: DELETE + uri: https://storagename.table.core.windows.net/Tables('uttableda814a7') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 25 Aug 2020 15:09:38 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 25 Aug 2020 15:09:38 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:38 GMT + x-ms-version: + - '2019-07-07' + method: DELETE + uri: https://storagename.table.core.windows.net/Tables('querytableda814a7') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 25 Aug 2020 15:09:38 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_unconditionally.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_unconditionally.yaml new file mode 100644 index 000000000000..1fc4f6a9e7f6 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_unconditionally.yaml @@ -0,0 +1,421 @@ +interactions: +- request: + body: '{"TableName": "uttablec19d1802"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:38 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:38 GMT + x-ms-version: + - '2019-07-07' + 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":"uttablec19d1802"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:38 GMT + location: + - https://storagename.table.core.windows.net/Tables('uttablec19d1802') + 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: 201 + message: Created +- request: + body: '{"PartitionKey": "pkc19d1802", "RowKey": "rkc19d1802", "age": "39", "age@odata.type": + "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1, + "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday": + "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '537' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:38 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:38 GMT + x-ms-version: + - '2019-07-07' + method: POST + uri: https://storagename.table.core.windows.net/uttablec19d1802 + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablec19d1802/@Element","odata.etag":"W/\"datetime''2020-08-25T15%3A09%3A39.0475628Z''\"","PartitionKey":"pkc19d1802","RowKey":"rkc19d1802","Timestamp":"2020-08-25T15:09:39.0475628Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:38 GMT + etag: + - W/"datetime'2020-08-25T15%3A09%3A39.0475628Z'" + location: + - https://storagename.table.core.windows.net/uttablec19d1802(PartitionKey='pkc19d1802',RowKey='rkc19d1802') + 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: 201 + message: Created +- request: + body: '{"TableName": "querytablec19d1802"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '35' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:38 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:38 GMT + x-ms-version: + - '2019-07-07' + 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":"querytablec19d1802"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:38 GMT + location: + - https://storagename.table.core.windows.net/Tables('querytablec19d1802') + 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: 201 + message: Created +- request: + body: '{"PartitionKey": "pkc19d1802", "RowKey": "rkc19d18021", "age": "39", "age@odata.type": + "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1, + "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday": + "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '538' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:38 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:38 GMT + x-ms-version: + - '2019-07-07' + method: POST + uri: https://storagename.table.core.windows.net/querytablec19d1802 + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablec19d1802/@Element","odata.etag":"W/\"datetime''2020-08-25T15%3A09%3A39.2459968Z''\"","PartitionKey":"pkc19d1802","RowKey":"rkc19d18021","Timestamp":"2020-08-25T15:09:39.2459968Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:39 GMT + etag: + - W/"datetime'2020-08-25T15%3A09%3A39.2459968Z'" + location: + - https://storagename.table.core.windows.net/querytablec19d1802(PartitionKey='pkc19d1802',RowKey='rkc19d18021') + 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: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:38 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:38 GMT + x-ms-version: + - '2019-07-07' + method: GET + uri: https://storagename.table.core.windows.net/uttablec19d1802(PartitionKey='pkc19d1802',RowKey='rkc19d1802') + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablec19d1802/@Element","odata.etag":"W/\"datetime''2020-08-25T15%3A09%3A39.0475628Z''\"","PartitionKey":"pkc19d1802","RowKey":"rkc19d1802","Timestamp":"2020-08-25T15:09:39.0475628Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:39 GMT + etag: + - W/"datetime'2020-08-25T15%3A09%3A39.0475628Z'" + 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Tue, 25 Aug 2020 15:09:38 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:38 GMT + x-ms-version: + - '2019-07-07' + method: DELETE + uri: https://storagename.table.core.windows.net/uttablec19d1802(PartitionKey='pkc19d1802',RowKey='rkc19d1802') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 25 Aug 2020 15:09:39 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + 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: + - Tue, 25 Aug 2020 15:09:39 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:39 GMT + x-ms-version: + - '2019-07-07' + method: GET + uri: https://storagename.table.core.windows.net/uttablec19d1802(PartitionKey='pkc19d1802',RowKey='rkc19d1802') + response: + body: + string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The + specified resource does not exist.\nRequestId:7d344862-2002-0076-67f1-7a95e2000000\nTime:2020-08-25T15:09:39.5396215Z"}}}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 25 Aug 2020 15:09:39 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: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 25 Aug 2020 15:09:39 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:39 GMT + x-ms-version: + - '2019-07-07' + method: DELETE + uri: https://storagename.table.core.windows.net/Tables('uttablec19d1802') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 25 Aug 2020 15:09:39 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 25 Aug 2020 15:09:39 GMT + User-Agent: + - azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 25 Aug 2020 15:09:39 GMT + x-ms-version: + - '2019-07-07' + method: DELETE + uri: https://storagename.table.core.windows.net/Tables('querytablec19d1802') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 25 Aug 2020 15:09:39 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-07-07' + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_wrong_etag.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_wrong_etag.yaml new file mode 100644 index 000000000000..e4b7ce91ee87 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_wrong_etag.yaml @@ -0,0 +1,287 @@ +interactions: +- request: + body: '{"TableName": "uttable4e1a15d3"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 01 Sep 2020 22:47:23 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 22:47:23 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":"uttable4e1a15d3"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 01 Sep 2020 22:47:23 GMT + location: + - https://storagename.table.core.windows.net/Tables('uttable4e1a15d3') + 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 +- request: + body: '{"TableName": "testtable"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '26' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 01 Sep 2020 22:47:23 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 22:47:23 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":"testtable"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 01 Sep 2020 22:47:23 GMT + location: + - https://storagename.table.core.windows.net/Tables('testtable') + 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 +- request: + body: '{"PartitionKey": "PartitionKey", "RowKey": "RowKey", "Value": 1}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '64' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 01 Sep 2020 22:47:23 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 22:47:23 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://storagename.table.core.windows.net/testtable + response: + body: + string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#testtable/@Element","odata.etag":"W/\"datetime''2020-09-01T22%3A47%3A23.8624821Z''\"","PartitionKey":"PartitionKey","RowKey":"RowKey","Timestamp":"2020-09-01T22:47:23.8624821Z","Value":1}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 01 Sep 2020 22:47:23 GMT + etag: + - W/"datetime'2020-09-01T22%3A47%3A23.8624821Z'" + location: + - https://storagename.table.core.windows.net/testtable(PartitionKey='PartitionKey',RowKey='RowKey') + 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 +- request: + body: '{"PartitionKey": "PartitionKey", "RowKey": "RowKey", "Value": 2}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '64' + Content-Type: + - application/json + DataServiceVersion: + - '3.0' + Date: + - Tue, 01 Sep 2020 22:47:23 GMT + If-Match: + - '*' + 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 22:47:23 GMT + x-ms-version: + - '2019-02-02' + method: PATCH + uri: https://storagename.table.core.windows.net/testtable(PartitionKey='PartitionKey',RowKey='RowKey') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 01 Sep 2020 22:47:23 GMT + etag: + - W/"datetime'2020-09-01T22%3A47%3A23.9316648Z'" + 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 +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Tue, 01 Sep 2020 22:47:23 GMT + If-Match: + - W/"datetime'2020-09-01T22%3A47%3A23.8624821Z'" + 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 22:47:23 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://storagename.table.core.windows.net/testtable(PartitionKey='PartitionKey',RowKey='RowKey') + response: + body: + string: 'UpdateConditionNotSatisfiedThe update condition specified in the request was not satisfied. + + RequestId:19f78e3e-6002-0030-7bb1-8038cd000000 + + Time:2020-09-01T22:47:23.9939039Z' + headers: + cache-control: + - no-cache + content-type: + - application/xml;charset=utf-8 + date: + - Tue, 01 Sep 2020 22:47:23 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: 412 + message: Precondition Failed +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 01 Sep 2020 22:47:23 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 22:47:23 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://storagename.table.core.windows.net/Tables('uttable4e1a15d3') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 01 Sep 2020 22:47:23 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 +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity.py b/sdk/tables/azure-data-tables/tests/test_table_entity.py index 03b0775e155f..70d60c9370e7 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity.py @@ -22,7 +22,8 @@ from azure.core.exceptions import ( HttpResponseError, ResourceNotFoundError, - ResourceExistsError) + ResourceExistsError, + ResourceModifiedError) from azure.data.tables._entity import TableEntity, EntityProperty, EdmType from azure.data.tables._models import TableSasPermissions, AccessPolicy, UpdateMode @@ -641,6 +642,164 @@ def test_get_entity_if_match(self, resource_group, location, storage_account, st match_condition=MatchConditions.IfNotModified ) + with self.assertRaises(ResourceNotFoundError): + resp = self.table.get_entity(partition_key=entity['PartitionKey'], + row_key=entity['RowKey']) + + # Assert + finally: + self._tear_down() + + # @pytest.mark.skip("pending") + @GlobalStorageAccountPreparer() + def test_get_entity_if_match_wrong_etag(self, resource_group, location, storage_account, storage_account_key): + # Arrange + self._set_up(storage_account, storage_account_key) + try: + table = self.ts.create_table("testtable") + entity = { + "PartitionKey": "PartitionKey", + "RowKey": "RowKey", + "Value": 1 + } + + response = table.create_entity(entity=entity) + old_etag = response["etag"] + + entity["Value"] = 2 + response = table.update_entity(entity=entity) + + with self.assertRaises(HttpResponseError): + table.delete_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'], + etag=old_etag, + match_condition=MatchConditions.IfNotModified + ) + + finally: + self._tear_down() + + # @pytest.mark.skip("pending") + @GlobalStorageAccountPreparer() + def test_get_entity_if_match_modified(self, resource_group, location, storage_account, storage_account_key): + # Arrange + self._set_up(storage_account, storage_account_key) + try: + entity, etag = self._insert_random_entity() + self._create_query_table(1) + + # Act + # Do a get and confirm the etag is parsed correctly by using it + # as a condition to delete. + resp = self.table.get_entity(partition_key=entity['PartitionKey'], + row_key=entity['RowKey']) + + # This is ignoring the match_condition param and will delete the entity + self.table.delete_entity( + partition_key=resp['PartitionKey'], + row_key=resp['RowKey'], + etag=etag, + match_condition=MatchConditions.IfModified + ) + + with self.assertRaises(ResourceNotFoundError): + resp = self.table.get_entity(partition_key=entity['PartitionKey'], + row_key=entity['RowKey']) + + # Assert + finally: + self._tear_down() + + # @pytest.mark.skip("pending") + @GlobalStorageAccountPreparer() + def test_get_entity_if_match_unconditionally(self, resource_group, location, storage_account, storage_account_key): + # Arrange + self._set_up(storage_account, storage_account_key) + try: + entity, etag = self._insert_random_entity() + self._create_query_table(1) + + # Act + # Do a get and confirm the etag is parsed correctly by using it + # as a condition to delete. + resp = self.table.get_entity(partition_key=entity['PartitionKey'], + row_key=entity['RowKey']) + + # This is ignoring the match_condition param and will delete the entity + self.table.delete_entity( + partition_key=resp['PartitionKey'], + row_key=resp['RowKey'], + etag='abcdef', + match_condition=MatchConditions.Unconditionally + ) + + with self.assertRaises(ResourceNotFoundError): + resp = self.table.get_entity(partition_key=entity['PartitionKey'], + row_key=entity['RowKey']) + + # Assert + finally: + self._tear_down() + + # @pytest.mark.skip("pending") + @GlobalStorageAccountPreparer() + def test_get_entity_if_match_present(self, resource_group, location, storage_account, storage_account_key): + # Arrange + self._set_up(storage_account, storage_account_key) + try: + entity, etag = self._insert_random_entity() + self._create_query_table(1) + + # Act + # Do a get and confirm the etag is parsed correctly by using it + # as a condition to delete. + resp = self.table.get_entity(partition_key=entity['PartitionKey'], + row_key=entity['RowKey']) + + # This is ignoring the match_condition param and will delete the entity + self.table.delete_entity( + partition_key=resp['PartitionKey'], + row_key=resp['RowKey'], + etag='abcdef', + match_condition=MatchConditions.IfPresent + ) + + with self.assertRaises(ResourceNotFoundError): + resp = self.table.get_entity(partition_key=entity['PartitionKey'], + row_key=entity['RowKey']) + + # Assert + finally: + self._tear_down() + + # @pytest.mark.skip("pending") + @GlobalStorageAccountPreparer() + def test_get_entity_if_match_missing(self, resource_group, location, storage_account, storage_account_key): + # Arrange + self._set_up(storage_account, storage_account_key) + try: + entity, etag = self._insert_random_entity() + self._create_query_table(1) + + # Act + # Do a get and confirm the etag is parsed correctly by using it + # as a condition to delete. + resp = self.table.get_entity(partition_key=entity['PartitionKey'], + row_key=entity['RowKey']) + + # This is ignoring the match_condition param and will delete the entity + self.table.delete_entity( + partition_key=resp['PartitionKey'], + row_key=resp['RowKey'], + etag='abcdef', + match_condition=MatchConditions.IfMissing + ) + + with self.assertRaises(ResourceNotFoundError): + resp = self.table.get_entity(partition_key=entity['PartitionKey'], + row_key=entity['RowKey']) + # Assert finally: self._tear_down()