This commit is contained in:
Travis Prescott 2016-05-05 16:10:13 -07:00
Родитель 8d22a8bc8c 8d21616be9
Коммит 2a7bb9f12b
14 изменённых файлов: 929 добавлений и 652 удалений

Просмотреть файл

@ -17,29 +17,74 @@ TEST_DEF = [
},
{
'test_name': 'name2',
'command': 'command2'
'script': script_class()
}
]
```
Simply add your new entries and run all tests. The test driver will automatically detect the new tests and run the command, show you the output, and query if it is correct. If so, it will save the HTTP recording into a YAML file, as well as the raw output into a dictionary called `expected_results.res`. When the test is replayed, as long as the test has an entry in `expected_results.res` and a corresponding .yaml file, the test will proceed automatically. If either the entry or the .yaml file are missing, the test will be re-recorded.
Simply add your new entries and run all tests. The test driver will automatically detect the new tests and run the commands, show you the output, and query if it is correct. If so, it will save the HTTP recording into a YAML file, as well as the raw output into a dictionary called `expected_results.res`. When the test is replayed, as long as the test has an entry in `expected_results.res` and a corresponding .yaml file, the test will proceed automatically. If either the entry or the .yaml file are missing, the test will be re-recorded.
If the tests are run on TravisCI, any tests which cannot be replayed will automatically fail.
##Recording Tests
##Types of Tests
Many tests, for example those which simply retrieve information, can simply be played back, verified and recorded.
The system currently accepts individual commands and script test objects. Individual commands will always display the output and query the user if the results are correct. These are the "old" style tests.
Other tests, such as create and delete scenarios, may require additional commands to set up for recording, or may require additional commands to verify the proper operation of a command. For example, several create commands output nothing on success. Thus, you'll find yourself staring at nothing with a prompt asking if that is the expected response.
To allow for more complex testing scenarios involving creating and deleting resources, long-running operations, or automated verification, use the script object method. To do so, simply create a class in the `command_specs.py` file with the following structure:
For these scenarios, I recommend having a second shell open, from which you can run any setup commands and then run any commands you need to verify the proper operation of the command in order to answer the prompt.
```Python
class MyScenarioTest(CommandTestScript):
def __init__(self):
super(MyScenarioTest, self).__init__(self.set_up, self.test_body, self.tear_down)
I don't recommend trying to structure your tests so that one test sets up for another, because in general you cannot guarantee the order in which the tests will run. Also, I don't recommend attempting to record large batches of tests at once. I generally add one to three tests at a time and leave the remaining new tests commented out. Running `testall.bat` will let me record these. Then I uncomment a few more and so on, until they are all recorded.
def set_up(self):
# Setup logic here
pass
def test_body(self):
# Main test logic
pass
def tear_down(self):
# clean up logic here
pass
```
The `set_up` and `tear_down` methods are optional and can be omitted. A number of helper methods are available for structuring your script tests.
####run(command_string)
This method executes a given command and returns the output. The results are not sent to the display or to expected results. Use this for:
- running commands that produce no output (the next statement will usually be a test)
- running commands that are needed for conditional logic or in setup/cleanup logic
####rec(command_string)
This method runs a given command and records its output to the display for manual verification. Using this command will force the user to verify the output via a Y/N prompt. If the user accepts the output, it will be saved to `expected_results.res`.
####test(command_string, checks)
This method runs a given command and automatically validates the output. The results are saved to `expected_results.res` if valid, but nothing is display on the screen. Valid checks include: `bool`, `str` and `dict`. A check with a `dict` can be used to check for multiple matching parameters (and logic). Child `dict` objects can be used as values to verify properties within nested objects.
####set_env(variable_name, value)
This method is a wrapper around `os.environ` and simply sets an environment variable to the specified value.
####pop_env(variable_name)
Another wrapper around `os.environ` this pops the value of the indicated environment variable.
####print_(string)
This method allows you to write to the display output, but does not add to the `expected_results.res` file. One application of this would be to print information ahead of a `rec` statement so the person validating the output knows what to look for.
##Long Running Operations (LRO)
The system now allows the testing of long running operations. Regardless of the time required to record the test, playback will truncate the long running operation to finish very quickly. However, because re-recording these actions can take a very long time, it is recommended that each LRO scenario be individually tested (possibly in tandem with a delete operation) rather than as part of a larger scenario.
##Limitations
The current system saves time, but has some limitations.
+ Certain commands require manual steps to setup or verify
+ You can't test for things like 'this input results in an exception'. It simply tests that the response equals an expected response.
+ This system does not work with long running operations. While it technically does, the resulting recording takes as long as the original call, which negates some of the key benefits of automated testing.

5
lintall Normal file
Просмотреть файл

@ -0,0 +1,5 @@
#!/bin/bash
export PYTHONPATH=$PATHONPATH:./src
pylint -r n src/azure
python scripts/command_modules/pylint.py

Просмотреть файл

@ -83,10 +83,7 @@ class CommandTestScript(object): #pylint: disable=too-many-instance-attributes
if isinstance(checks, bool):
result_val = str(result).lower().replace('"', '')
bool_val = result_val in ('yes', 'true', 't', '1')
try:
assert bool_val == checks
except AssertionError as ex:
raise ex
elif isinstance(checks, str):
assert result.replace('"', '') == checks
elif isinstance(checks, dict):
@ -95,8 +92,7 @@ class CommandTestScript(object): #pylint: disable=too-many-instance-attributes
elif checks is None:
assert result is None or result == ''
else:
raise IncorrectUsageError('test only accepts a dictionary of json properties or ' + \
'a boolean value.')
raise IncorrectUsageError('unsupported type \'{}\' in test'.format(type(checks)))
def set_env(self, key, val): #pylint: disable=no-self-use
os.environ[key] = val

Просмотреть файл

@ -279,7 +279,7 @@ build_operation(
'storage blob service-properties', None, _blob_data_service_factory,
[
AutoCommandDefinition(BlockBlobService.get_blob_service_properties,
'[ServiceProperties]', 'show'),
'ServiceProperties', 'show'),
AutoCommandDefinition(BlockBlobService.set_blob_service_properties,
'ServiceProperties', 'set')
], command_table, PARAMETER_ALIASES, STORAGE_DATA_CLIENT_ARGS)

Просмотреть файл

@ -4,7 +4,6 @@ import collections
import json
import os
import sys
from time import sleep
from six import StringIO
@ -27,6 +26,31 @@ def _get_connection_string(runner):
connection_string = out.replace('Connection String : ', '')
runner.set_env('AZURE_STORAGE_CONNECTION_STRING', connection_string)
class StorageAccountCreateAndDeleteTest(CommandTestScript):
def set_up(self):
self.account = 'testcreatedelete'
self.run('storage account delete -g {} -n {}'.format(RESOURCE_GROUP_NAME, self.account))
result = json.loads(self.run('storage account check-name --name {} -o json'.format(self.account)))
if not result['nameAvailable']:
raise RuntimeError('Failed to delete pre-existing storage account {}. Unable to continue test.'.format(self.account))
def test_body(self):
account = self.account
rg = RESOURCE_GROUP_NAME
s = self
s.run('storage account create --type Standard_LRS -l westus -n {} -g {}'.format(account, rg))
s.test('storage account check-name --name {}'.format(account),
{'nameAvailable': False, 'reason': 'AlreadyExists'})
s.run('storage account delete -g {} -n {}'.format(RESOURCE_GROUP_NAME, account))
s.test('storage account check-name --name {}'.format(account), {'nameAvailable': True})
def tear_down(self):
self.run('storage account delete -g {} -n {}'.format(RESOURCE_GROUP_NAME, self.account))
def __init__(self):
super(StorageAccountCreateAndDeleteTest, self).__init__(
self.set_up, self.test_body, self.tear_down)
class StorageAccountScenarioTest(CommandTestScript):
def test_body(self):
@ -54,7 +78,8 @@ class StorageAccountScenarioTest(CommandTestScript):
s.run('storage account set -g {} -n {} --type Standard_LRS'.format(rg, account))
def __init__(self):
super(StorageAccountScenarioTest, self).__init__(None, self.test_body, None)
super(StorageAccountScenarioTest, self).__init__(
None, self.test_body, None)
class StorageBlobScenarioTest(CommandTestScript):
@ -63,9 +88,9 @@ class StorageBlobScenarioTest(CommandTestScript):
self.rg = RESOURCE_GROUP_NAME
self.proposed_lease_id = 'abcdabcd-abcd-abcd-abcd-abcdabcdabcd'
self.new_lease_id = 'dcbadcba-dcba-dcba-dcba-dcbadcbadcba'
self.date = '2016-04-08T12:00Z'
self.date = '2016-04-01t12:00z'
_get_connection_string(self)
sas_token = self.run('storage account generate-sas --services b --resource-types sco --permission rwdl --expiry 2017-01-01t00:00z')
sas_token = self.run('storage account generate-sas --services b --resource-types sco --permission rwdl --expiry 2100-01-01t00:00z')
self.set_env('AZURE_SAS_TOKEN', sas_token)
self.set_env('AZURE_STORAGE_ACCOUNT', STORAGE_ACCOUNT_NAME)
self.pop_env('AZURE_STORAGE_CONNECTION_STRING')
@ -187,7 +212,7 @@ class StorageFileScenarioTest(CommandTestScript):
self.share1 = 'testshare01'
self.share2 = 'testshare02'
_get_connection_string(self)
sas_token = self.run('storage account generate-sas --services f --resource-types sco --permission rwdl --expiry 2017-01-01t00:00z')
sas_token = self.run('storage account generate-sas --services f --resource-types sco --permission rwdl --expiry 2100-01-01t00:00z')
self.set_env('AZURE_SAS_TOKEN', sas_token)
self.set_env('AZURE_STORAGE_ACCOUNT', STORAGE_ACCOUNT_NAME)
self.pop_env('AZURE_STORAGE_CONNECTION_STRING')
@ -301,28 +326,20 @@ class StorageFileScenarioTest(CommandTestScript):
super(StorageFileScenarioTest, self).__init__(self.set_up, self.test_body, self.tear_down)
TEST_DEF = [
# STORAGE ACCOUNT TESTS
{
'test_name': 'storage_account',
'script': StorageAccountScenarioTest()
},
# TODO: Enable when item #117262541 is complete
#{
# 'test_name': 'storage_account_create',
# 'command': 'storage account create --type Standard_LRS -l westus -g travistestresourcegroup --account-name teststorageaccount04'
#},
{
'test_name': 'storage_account_delete',
'command': 'storage account delete -g travistestresourcegroup --account-name teststorageaccount04'
'test_name': 'storage_account_create_and_delete',
'script': StorageAccountCreateAndDeleteTest()
},
# STORAGE CONTAINER TESTS
{
'test_name': 'storage_blob',
'script': StorageBlobScenarioTest()
},
# STORAGE SHARE TESTS
{
'test_name': 'storage_file',
'script': StorageFileScenarioTest()
},
}
]

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1,8 +1,40 @@
interactions:
- request:
body: !!binary |
eyJ0eXBlIjogIk1pY3Jvc29mdC5TdG9yYWdlL3N0b3JhZ2VBY2NvdW50cyIsICJuYW1lIjogInRl
c3RzdG9yYWdlb21lZ2EifQ==
body: client_id=04b07795-8ddb-461a-bbee-02f9e1bf7b46&refresh_token=AAABAAAAiL9Kn2Z27UubvWFPbm0gLQoucyuhWVsJeWlI9dGHcCp-UEliGxmPaPMbHACErdm4Huw62OZuSF7H7LLFXMN7fuIPFNqE7f_QF9QQyD5Ui8KRfhduYlulJGP7ST-diYbpFNIoleXt4T4ipguWePyAPoInxQaOmFUJ6NywQalErbaG9ld99xzQ-RDn4aoH_GtUy7E761e8HojR47texNpxUUn_fSDseHaOuH7NXjp9_5K8ssdZwXA2zutzFVnfVfrY1tfO1iXreBLruchA8iRpP_B-wesZuwYCZ0CT4-lOuaYTO59YeFn2I7Rk_zPWlLKQ7GRBAhXHcOqPjk6CpPTeO1qFKHwkX_yMUZAV7QwrlxEgcOASxf8dujZKGTZdqDrGkwfstijCCgGk6wmNpDU8TaR3gAc8KeOOd_8Q-RGUnLRtO3sq8iGUSpwxJxjHefwtZKRnKBHX2yuZVJUTyELIWEfUNbFY9IlRCdQfI1rm-n9tftUao-ibqOUO8E8v4s0W7U0X8iQG5h59FJn0DT8CURJyFUseayuVEui5pZ75wC-wQUkkyh7ugHXU5GyfzE5HeeTUUsIeHG7k5MJhelX0_VEBCCFFxHdee4e75BUhr_TyGqYrJaxEdA9GfCIzN6-NFXGc2A_2oQ6i6Nhjai5WQiAA&grant_type=refresh_token&resource=https%3A%2F%2Fmanagement.core.windows.net%2F
headers:
Accept: ['*/*']
Accept-Charset: [utf-8]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['812']
User-Agent: [python-requests/2.9.1]
content-type: [application/x-www-form-urlencoded]
return-client-request-id: ['true']
x-client-CPU: [x86]
x-client-OS: [win32]
x-client-SKU: [Python]
x-client-Ver: [0.2.0]
method: POST
uri: https://login.microsoftonline.com/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/oauth2/token?api-version=1.0
response:
body: {string: '{"token_type":"Bearer","scope":"user_impersonation","expires_in":"3599","expires_on":"1461688499","not_before":"1461684599","resource":"https://management.core.windows.net/","access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSIsImtpZCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuY29yZS53aW5kb3dzLm5ldC8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwiaWF0IjoxNDYxNjg0NTk5LCJuYmYiOjE0NjE2ODQ1OTksImV4cCI6MTQ2MTY4ODQ5OSwiYWNyIjoiMSIsImFtciI6WyJwd2QiXSwiYXBwaWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJhcHBpZGFjciI6IjAiLCJmYW1pbHlfbmFtZSI6IkFkbWluMiIsImdpdmVuX25hbWUiOiJBZG1pbjIiLCJncm91cHMiOlsiZTRiYjBiNTYtMTAxNC00MGY4LTg4YWItM2Q4YThjYjBlMDg2Il0sImlwYWRkciI6IjE2Ny4yMjAuMS4xODYiLCJuYW1lIjoiQWRtaW4yIiwib2lkIjoiNTk2M2Y1MGMtN2M0My00MDVjLWFmN2UtNTMyOTRkZTc2YWJkIiwicHVpZCI6IjEwMDNCRkZEOTU5Rjg0MjMiLCJzY3AiOiJ1c2VyX2ltcGVyc29uYXRpb24iLCJzdWIiOiJzRGdleFJ3Q05JZlktaHpRampDRHZaVDdJemRmbzRTeXJyNHgwZEROelI0IiwidGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIiwidW5pcXVlX25hbWUiOiJhZG1pbjJAQXp1cmVTREtUZWFtLm9ubWljcm9zb2Z0LmNvbSIsInVwbiI6ImFkbWluMkBBenVyZVNES1RlYW0ub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIiwid2lkcyI6WyI2MmU5MDM5NC02OWY1LTQyMzctOTE5MC0wMTIxNzcxNDVlMTAiXX0.AHEBTJ0eP-3mJMJV4KBqBHuntEBIL5ND6E5TPkrKgbAtpLED7RJNIBvWiw9guKgzabyWCT2mcb2tVAFM-YmQ-7VlYBGsELtsNiSnuYshiR-586vu5BSwYpeRMbk7mNZEy8inndY1znPYLdfZFTPBchHxJ5tQDWHtNE42Yejg5UtZYXqMQSsslecItSg_E2HBekbbBGlD9muri5baiRF131_pT2rLa-MynoZwxgCxOIBf0De7h0cfQTwyblpi_MKrnQ2jOSiuaQ2wZ1unywYI8lNtAbYLDGLzY9Kg5y_eOQY-q02Y--ONCGbuiD1kNwRxEx-FrNSnpgqrp5zv4X1Ulw","refresh_token":"AAABAAAAiL9Kn2Z27UubvWFPbm0gLbcBSC68FfW4jj8KcqEuydKT4QOY0WeoAc8SeV_OHp9fmwbHsl8mL_X_LtdMGvM62L9bYOfFgvyDbhgJ-aY1HAFXrl-ggt-KGzqD9ir1W_Ep7pjKnRL1aRlvZ5iH2m7bCU3ceC2l3BY_IYrYXB6BBMdcP256RwQroNmNO7vZyw2Uker7PlUwy2SqYzSIg0C3NMNn3UC1A2mmBi_dRaD-LkrIUqUS_DeoMQrkh92S5le4MtKkMQ6IKcEuTTA0aVt7Fhh4CLebF-dDC0HZDAS6QnOgN_lOeNDVHViREDuADAEqgUNxMF6z5a6AFJdoGRz4MZpuugX0_jWLOJcgG6scFcJOmnXrOr_0IQhT44MiQ8jdeiuKIKEFhoCQ4MSFUydCPxpZhg-KwPMRLLKMHUYUvzUp0_O1YH588hz6ClEhhz8dk-wYadFKq7ZqSJR5j2DSO4ATmCBb6vPfCcZz5jV6aETDPIWXoMW2wTHQi2sT6dLC3eJo6yFshduZUrOAnHKX9taR8Wv6MbYrEcnk7yIPD5xFbtYDV5-YnvzVxmAZBnjRJEcQVQs5tSEjxxo6QiQJinc4uEHo6fyuaK_XZ8y63RW4HuPRQm0ckia3uS62OdRYy4f9ls5ppLVSK4yclrOSRCAA"}'}
headers:
Cache-Control: ['no-cache, no-store']
Content-Length: ['2346']
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 26 Apr 2016 15:34:59 GMT']
Expires: ['-1']
P3P: [CP="DSP CUR OTPi IND OTRi ONL FIN"]
Pragma: [no-cache]
Server: [Microsoft-IIS/8.5]
Set-Cookie: [flight-uxoptin=true; path=/; secure; HttpOnly, x-ms-gateway-slice=productionb;
path=/; secure; HttpOnly, stsservicecookie=ests; path=/; secure; HttpOnly]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
X-Content-Type-Options: [nosniff]
X-Powered-By: [ASP.NET]
status: {code: 200, message: OK}
- request:
body: '{"name": "teststorageomega", "type": "Microsoft.Storage/storageAccounts"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
@ -24,7 +56,7 @@ interactions:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:24 GMT']
Date: ['Tue, 26 Apr 2016 15:34:59 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -32,9 +64,7 @@ interactions:
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: !!binary |
eyJ0eXBlIjogIk1pY3Jvc29mdC5TdG9yYWdlL3N0b3JhZ2VBY2NvdW50cyIsICJuYW1lIjogInRy
YXZpc3Rlc3RyZXNvdXJjZWdyMzAxNCJ9
body: '{"name": "travistestresourcegr3014", "type": "Microsoft.Storage/storageAccounts"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
@ -57,7 +87,7 @@ interactions:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:25 GMT']
Date: ['Tue, 26 Apr 2016 15:35:00 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -87,14 +117,14 @@ interactions:
K7zyus2Ws6ye/f7PX72mptM6Z+BvCga4t7P76fbO/vbOp2/2dh/t7z/aPxjv7+w8eLh7/6eo9aou
Fll9fbqcraqCUAb4SVlN6M15266aR3ejgxijzXha1fn4qljOqqtmvMzbuwTwvCjR7caX0Sb68i9a
55jFzW9zo+jrbTa5uXNuFHn9l1hiPI9MD00AcQN9WCwviOAtunm9nk7zfJbP6PuGPls3X56/FBD0
bXaZFSX6AuQ2u2DSEmD6itqfVxX9Mslq/lYm8kZ+orb/L+PvCIx7O7v7NMBNPD78FnX+QXx+b3v3
/pu9e4926H974wcPD/Z3Pt27LZ8PoHV7Xh8CgHZRAMzKt4HADaMgWmaxW4DghhEQxH9KnJ9Fvl9W
S7zJH8ls3shcH/2S7/+S5P8BC9XYt9kFAAA=
bXaZFSX6AuQ2u2DSEmD6itqfVxX9Mslq/lYm8kZ+orb/L+PvCIx7O7v7NMBNPD78FnX+gXy+9+mb
nZ1H9L/9++MHew8fPjj49LZ8PoDW7Xl9CADaRQEwK98GAjeMgmiZxW4BghtGQBD/KXF+Fvl+WS3x
Jn8ks3kjc330S77/S5L/B76UIYXZBQAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:25 GMT']
Date: ['Tue, 26 Apr 2016 15:35:01 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -121,15 +151,15 @@ interactions:
o0cf3W3Wk2ZaF6u2qJbN3Z3J7vmn+w92t3cn5zvb+7NZtp3l03vb08nDvQd75zsP7z/cuVvnTbWu
p/nndbVeNXfbOrssmjZvWvPFBb64u6qry2KW183dL4ppXTXVeTt+3VZ1dpHfbeTn8XRarZdtHMa9
nd39j0YfldU0A3KE7BV9v27os2W2yOnvDW9R56u8bou8+ejRL/4ok37eXK/w2us2W86yevb7P3/1
mppO65w7eFMw0L2d3U+3d+5t795/s3fv0Q79b2/84OHB/s6nez9FrVd1scjq69PlbFUVhDrAT8pq
Qm/O23bVPLo7OJgx2o2nVZ2Pr4rlrLpqxsu8vUtAz4sSXd8IAO2iAH7ROl/fCgI3jIJos8ntkOCG
ERC/xBLneWTKaEIIHH1YLC9oAlp09Xo9neb5LJ/R9w19tm6+PH8pIOjb7DIrSvQFyG12waReVku8
yR/JbN7IXB/9kuT/AWlsbsbtAgAA
mppO65w7eFMw0L2d3U+3d/a39z59s7PziP63f3/8YO/hwwcHn/4UtV7VxSKrr0+Xs1VVEOoAPymr
Cb05b9tV8+ju4GDGaDeeVnU+viqWs+qqGS/z9i4BPS9KdH0jALSLAvhF63x9KwjcMAqizSa3Q4Ib
RkD8Ekuc55EpowkhcPRhsbygCWjR1ev1dJrns3xG3zf02br58vylgKBvs8usKNEXILfZBZN6WS3x
Jn8ks3kjc330S5L/B131zF/tAgAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:26 GMT']
Date: ['Tue, 26 Apr 2016 15:35:01 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -153,14 +183,14 @@ interactions:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xb5yk
6UeXWbnOP3qUfg9/pSl/iOej9bJo6fOPTqr1sv1oZD+frus6X7Y/qe/t3XdflcWC39nd2XEfLrMF
2lnA9JHp86PXbVVnF/nxdIpOGtcLNSqraVYWP8hnpifTOrXNTetfIr/wj+//xskv+X8Aex9GGNoA
6UeXWbnOP3qUfg9/pSl/iOej9bJo6fOPTqr1sv1oZD+frus6X7Y/qe/tPXBflcWC39nd2XEfLrMF
2lnA9JHp86PXbVVnF/nxdIpOGtcLNSqraVYWP8hnpifTOrXNTetfIr/wj+//xskv+X8AtiYxadoA
AAA=
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:27 GMT']
Date: ['Tue, 26 Apr 2016 15:35:02 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -185,15 +215,15 @@ interactions:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR2/z
692PHn20/9Xl5z+9OL/+4n5bPVu+efnuyyc/8eWrNru8/H2uf/oX/cR69mbvfvP57/P87Lvr9ZuX
s4O7d69fffL21f3TZ6/fnX358mD5xWr39S/6pHi9d/ng1dl3Xz188+b57sVnn300Qg971EP75u7T
y3sP5z/19O2nD59+Wbd3f5/Pd6+/uvyJi+efVj/x7cv946J98NUPLh8uf69l81PfeVGUX9xb/0S7
W1Xvvjr+qnhx9RPHr5+sH1xf7Zbvvvh9zl/93vfz6U/9BPXwS5L/ByTQAirGAAAA
692PHn00LSfvvru/+u7x5W7z5cvrd59fvDidTn7vH/xezXd+7+L8i/Ynnr16evnq/Nu/d72cXP3e
O4v2yd5P/17Xuz+990X13eVPP3/x6s3BT939vb+6eP3501fnb8rZWV0dPPmJzz77aIQe9qiHk7Pm
ZD1bZavPv/y9qst7n0zm2ecXz36vye917+16sVf+9LP5Fz+Y7h/Un05Pls0nP/HTP3n3/pudixdP
P1+f7r+7+H2ql1/Mqmeffjs72Hs5/bTav3j97QfHE/TwS5L/BzznsQjGAAAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:28 GMT']
Date: ['Tue, 26 Apr 2016 15:35:03 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -219,15 +249,15 @@ interactions:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR2/z
692PHn20/9Xl5z+9OL/+4n5bPVu+efnuyyc/8eWrNru8/H2uf/oX/cR69mbvfvP57/P87Lvr9ZuX
s4O7d69fffL21f3TZ6/fnX358mD5xWr39S/6pHi9d/ng1dl3Xz188+b57sVnn300Qg971EP75u7T
y3sP5z/19O2nD59+Wbd3f5/Pd6+/uvyJi+efVj/x7cv946J98NUPLh8uf69l81PfeVGUX9xb/0S7
W1Xvvjr+qnhx9RPHr5+sH1xf7Zbvvvh9zl/93vfz6U/9BPXwS5L/ByTQAirGAAAA
692PHn00LSfvvru/+u7x5W7z5cvrd59fvDidTn7vH/xezXd+7+L8i/Ynnr16evnq/Nu/d72cXP3e
O4v2yd5P/17Xuz+990X13eVPP3/x6s3BT939vb+6eP3501fnb8rZWV0dPPmJzz77aIQe9qiHk7Pm
ZD1bZavPv/y9qst7n0zm2ecXz36vye917+16sVf+9LP5Fz+Y7h/Un05Pls0nP/HTP3n3/pudixdP
P1+f7r+7+H2ql1/Mqmeffjs72Hs5/bTav3j97QfHE/TwS5L/BzznsQjGAAAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:28 GMT']
Date: ['Tue, 26 Apr 2016 15:35:04 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -236,8 +266,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: !!binary |
eyJrZXlOYW1lIjogImtleTEifQ==
body: '{"keyName": "key1"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
@ -254,15 +283,15 @@ interactions:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR2/z
692PHn1Uvvmpt18++Pb64KfzH/zE0wdv3tbV2+9Wrx7+4NNvv/7u5DsPirJZ3J19eXL55GL2+zz9
vDjb2T/+/JPf58Hnzer3/umL71we/PTdk59YXuw/fZ0dXO49bfY+2flF9y4+++yjEXrYox7aN3ef
Xt57OP+pp28/ffj0y7q9+/t8vnv91eVPXDz/tPqJb1/uHxftg69+cPlw+Xstm5/6zoui/OLe+ifa
3ap699XxV8WLq584fv1k/eD6ard898Xvc/7q976fT3/qJ6iHX5L8P2FhW9XGAAAA
692PHn300z+Z/8S737t49fSL4pP95+dPfnJ2f//z3+vu+fFB85MPqnzx4qfOF7/oyYt38wdnP70z
371b/eD3fvDFV7PJT55+5+LTH+wvnv1eu3tnn9+9/8XlbvH29/ryXfXmpPr8+LPPPhqhhz3q4eSs
OVnPVtnq8y9/r+ry3ieTefb5xbPfa/J73Xu7XuyVP/1s/sUPpvsH9afTk2XzyU/89E/evf9m5+LF
08/Xp/vvLn6f6uUXs+rZp9/ODvZeTj+t9i9ef/vB8eQnqIdfkvw/EUnTqsYAAAA=
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:29 GMT']
Date: ['Tue, 26 Apr 2016 15:35:06 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -271,8 +300,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: !!binary |
eyJrZXlOYW1lIjogImtleTIifQ==
body: '{"keyName": "key2"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
@ -289,15 +317,15 @@ interactions:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR2/z
692PHn1Uvvmpt18++Pb64KfzH/zE0wdv3tbV2+9Wrx7+4NNvv/7u5DsPirJZ3J19eXL55GL2+zz9
vDjb2T/+/JPf58Hnzer3/umL71we/PTdk59YXuw/fZ0dXO49bfY+2flF9y4+++yjEXrYox5ePXnY
nL+dnV+9/Imfvvvd9vWD2bJqX37afvmDp1mzevCLjr/7ne9+99lVfT395G393Wn97cv67sGTh/Np
ffB75+2rkyffvvry7vGzd3ffTtdN9RMXu7/P/tPjY+rhlyT/D/KUuz7GAAAA
692PHn300z+Z/8S737t49fSL4pP95+dPfnJ2f//z3+vu+fFB85MPqnzx4qfOF7/oyYt38wdnP70z
371b/eD3fvDFV7PJT55+5+LTH+wvnv1eu3tnn9+9/8XlbvH29/ryXfXmpPr8+LPPPhqhhz3q4ekX
D/e/ne/v7L3+vR8u509/rxfX5U/89NPf5wc//eT03ovy3s5P/NTdvdnJF+3xDxarvbuLL2ZnP/n0
6U89/fwXfX7wE1+92f/kp3/yi/WTN09fvJ3cm1/uvvzB8903sy+uqIdfkvw/NXZgQMYAAAA=
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:32 GMT']
Date: ['Tue, 26 Apr 2016 15:35:07 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -306,8 +334,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: !!binary |
eyJrZXlOYW1lIjogImtleTIifQ==
body: '{"keyName": "key2"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
@ -324,15 +351,15 @@ interactions:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR2/z
692PHn1Uvvmpt18++Pb64KfzH/zE0wdv3tbV2+9Wrx7+4NNvv/7u5DsPirJZ3J19eXL55GL2+zz9
vDjb2T/+/JPf58Hnzer3/umL71we/PTdk59YXuw/fZ0dXO49bfY+2flF9y4+++yjEXrYox6e/aD5
znfzl80X86u94+nzN69+n3y9u1P/3vtf3n/wi36y+M7bvezdL/rph5Pns6uT4+bk+uDTl012dbb6
dr0qri4enr14+ebd+vf59PqkrH7R85dnn/xksbuc/AT18EuS/wdH5dfXxgAAAA==
692PHn300z+Z/8S737t49fSL4pP95+dPfnJ2f//z3+vu+fFB85MPqnzx4qfOF7/oyYt38wdnP70z
371b/eD3fvDFV7PJT55+5+LTH+wvnv1eu3tnn9+9/8XlbvH29/ryXfXmpPr8+LPPPhqhhz3qYXFv
vvf226cPfu/9k4e/V/7m9zorz59en+wfv7j49Dtvl+tPfu8339l5+4Of/n3Wv3f2ZPZTy+zVuyc/
uP/sJ/baxcMX+7/Xen32g8XyzcnyavWDk09eZm/m7bsnrz+5oh5+SfL/AOw6p1HGAAAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:34 GMT']
Date: ['Tue, 26 Apr 2016 15:35:11 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -341,8 +368,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: !!binary |
eyJ0YWdzIjogeyJmb28iOiAiYmFyIiwgImNhdCI6ICIifX0=
body: '{"tags": {"foo": "bar", "cat": ""}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
@ -364,7 +390,7 @@ interactions:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:37 GMT']
Date: ['Tue, 26 Apr 2016 15:35:20 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -373,8 +399,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: !!binary |
eyJ0YWdzIjogeyJub25lIjogIiJ9fQ==
body: '{"tags": {"none": ""}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
@ -396,7 +421,7 @@ interactions:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:39 GMT']
Date: ['Tue, 26 Apr 2016 15:35:24 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -405,8 +430,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: !!binary |
eyJwcm9wZXJ0aWVzIjogeyJhY2NvdW50VHlwZSI6ICJTdGFuZGFyZF9HUlMifX0=
body: '{"properties": {"accountType": "Standard_GRS"}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
@ -428,7 +452,7 @@ interactions:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:41 GMT']
Date: ['Tue, 26 Apr 2016 15:35:24 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -437,8 +461,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: !!binary |
eyJwcm9wZXJ0aWVzIjogeyJhY2NvdW50VHlwZSI6ICJTdGFuZGFyZF9MUlMifX0=
body: '{"properties": {"accountType": "Standard_LRS"}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
@ -460,7 +483,7 @@ interactions:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Fri, 22 Apr 2016 20:18:43 GMT']
Date: ['Tue, 26 Apr 2016 15:35:26 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]

Просмотреть файл

@ -0,0 +1,195 @@
interactions:
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.1 requests/2.9.1 msrest/0.2.0 msrest_azure/0.2.1 storagemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/travistestresourcegroup/providers/Microsoft.Storage/storageAccounts/testcreatedelete?api-version=2015-06-15
response:
body: {string: ''}
headers:
Cache-Control: [no-cache]
Date: ['Tue, 26 Apr 2016 15:35:44 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 204, message: No Content}
- request:
body: '{"name": "testcreatedelete", "type": "Microsoft.Storage/storageAccounts"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['73']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.1 requests/2.9.1 msrest/0.2.0 msrest_azure/0.2.1 storagemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/checkNameAvailability?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR8ts
kR9fZkWZTcr8o0dtvc5/SfL/AAeYVbAXAAAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Tue, 26 Apr 2016 15:35:44 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: '{"properties": {"accountType": "Standard_LRS"}, "location": "westus"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['69']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.1 requests/2.9.1 msrest/0.2.0 msrest_azure/0.2.1 storagemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/travistestresourcegroup/providers/Microsoft.Storage/storageAccounts/testcreatedelete?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR2U1
zdqiWn706KOrvGnXzUejj1Z1tcrrtsibjx794o+y6bRaL9s316ucGr1us+Usq2e///NXrz/6Jb/k
/wFUNfWHQQAAAA==
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Tue, 26 Apr 2016 15:36:12 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: '{"name": "testcreatedelete", "type": "Microsoft.Storage/storageAccounts"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['73']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.1 requests/2.9.1 msrest/0.2.0 msrest_azure/0.2.1 storagemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/checkNameAvailability?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR4u8
abKL/KNHH72Z52nTVjX9lWbTabVetukyW+SztM2bdlrnWZvP8jJv87Ro0qykD2bXaZu9zZfjj0Yf
oenxZVaU2aQkcOdZ2eSjj6hRUy0J+rG0P31XNG3z0S9J/h8vo/wlegAAAA==
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Tue, 26 Apr 2016 15:36:12 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.1 requests/2.9.1 msrest/0.2.0 msrest_azure/0.2.1 storagemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/travistestresourcegroup/providers/Microsoft.Storage/storageAccounts/testcreatedelete?api-version=2015-06-15
response:
body: {string: ''}
headers:
Cache-Control: [no-cache]
Content-Length: ['0']
Date: ['Tue, 26 Apr 2016 15:36:16 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: '{"name": "testcreatedelete", "type": "Microsoft.Storage/storageAccounts"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['73']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.1 requests/2.9.1 msrest/0.2.0 msrest_azure/0.2.1 storagemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/checkNameAvailability?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR8ts
kR9fZkWZTcr8o0dtvc5/SfL/AAeYVbAXAAAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json]
Date: ['Tue, 26 Apr 2016 15:36:16 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.1 requests/2.9.1 msrest/0.2.0 msrest_azure/0.2.1 storagemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/travistestresourcegroup/providers/Microsoft.Storage/storageAccounts/testcreatedelete?api-version=2015-06-15
response:
body: {string: ''}
headers:
Cache-Control: [no-cache]
Date: ['Tue, 26 Apr 2016 15:36:17 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 204, message: No Content}
version: 1

Просмотреть файл

@ -1,27 +0,0 @@
interactions:
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.1 requests/2.9.1 msrest/0.2.0 msrest_azure/0.2.1 storagemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/travistestresourcegroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount04?api-version=2015-06-15
response:
body: {string: ''}
headers:
Cache-Control: [no-cache]
Content-Length: ['0']
Date: ['Fri, 08 Apr 2016 15:32:20 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 200, message: OK}
version: 1

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,5 +1,6 @@
import os
import unittest
import yaml
from azure.cli.utils.command_test_util import CommandTestGenerator
from command_specs import TEST_DEF, ENV_VAR
@ -7,11 +8,46 @@ class TestCommands(unittest.TestCase):
pass
recording_dir = os.path.join(os.path.dirname(__file__), 'recordings')
def _truncate_long_running_operation(data, lro_item):
interactions = data['interactions']
lro_index = interactions.index(lro_item)
for item in interactions[(lro_index+1):]:
method = item['request'].get('method')
code = item['response']['status'].get('code')
if method == 'GET' and code == 202:
interactions.remove(item)
elif method == 'GET' and code != 202:
lro_item['response'] = item['response']
interactions.remove(item)
return
def _shorten_long_running_operations(test_name):
''' Speeds up playback of tests that originally required HTTP polling by replacing the initial
request with the eventual response. '''
yaml_path = os.path.join(recording_dir, '{}.yaml'.format(test_name))
if not os.path.isfile(yaml_path):
return
with open(yaml_path, 'r+b') as f:
data = yaml.load(f)
for item in data['interactions']:
method = item['request'].get('method')
code = item['response']['status'].get('code')
# breaking a lease produces this pattern but should NOT be modified
lease_action = item['request']['headers'].get('x-ms-lease-action')
lease_action = lease_action[0] if lease_action else None
if method == 'PUT' and code == 202 and lease_action != 'break':
_truncate_long_running_operation(data, item)
f.seek(0)
f.write(yaml.dump(data).encode('utf-8'))
f.truncate()
generator = CommandTestGenerator(recording_dir, TEST_DEF, ENV_VAR)
tests = generator.generate_tests()
for test_name in tests:
_shorten_long_running_operations(test_name)
setattr(TestCommands, test_name, tests[test_name])
if __name__ == '__main__':
unittest.main()

5
testall Executable file
Просмотреть файл

@ -0,0 +1,5 @@
#!/bin/bash
export PYTHONPATH=$PATHONPATH:./src
python -m unittest discover -s src/azure/cli/tests
python scripts/command_modules/test.py