Skip to content

Commit 3291ecf

Browse files
author
Hugues Valois
committed
Merge pull request #396 from huguesv/dev4
Dev4
2 parents 91e41c5 + df29cae commit 3291ecf

File tree

343 files changed

+837788
-948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+837788
-948
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ TestResults/
2222
# Credentials
2323
credentials_real.json
2424
testsettings_local.json
25+
servicebus_settings_real.py
26+
storage_settings_real.py
27+
legacy_mgmt_settings_real.py
28+
mgmt_settings_real.py
2529

2630
# User-specific files
2731
*.suo
@@ -45,3 +49,4 @@ $RECYCLE.BIN/
4549
src/build
4650
*.iml
4751
/doc/_build
52+
/.vs/config/applicationhost.config

ChangeLog.txt

+24
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ The following have moved from 'azure' to 'azure.storage':
2626
DEV_ACCOUNT_NAME
2727
DEV_ACCOUNT_KEY
2828

29+
30+
TEST FAILURES
31+
=============
32+
33+
StorageBlobTest
34+
---------------
35+
(fail in playback mode)
36+
test_get_blob_to_text_chunked_download
37+
test_put_block_blob_from_text_chunked_upload
38+
39+
StorageTableTest
40+
----------------
41+
(fail in any mode)
42+
test_get_table_acl
43+
test_get_table_acl_iter
44+
test_set_table_acl
45+
test_set_table_acl_with_empty_signed_identifiers
46+
test_set_table_acl_with_empty_signed_identifiers
47+
48+
StorageQueueTest
49+
----------------
50+
<none>
51+
52+
2953
2015-06-16 Version 0.11.1
3054

3155
* Azure storage connection string support

azure-storage/azure/storage/_http/batchclient.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ class _BatchClient(_HTTPClient):
5858
'''
5959

6060
def __init__(self, service_instance, authentication,
61-
protocol='http', timeout=65):
62-
_HTTPClient.__init__(self, service_instance, protocol=protocol, timeout=timeout)
61+
protocol='http', request_session=None, timeout=65, user_agent=''):
62+
_HTTPClient.__init__(self, service_instance, protocol=protocol, request_session=request_session, timeout=timeout, user_agent=user_agent)
6363
self.authentication = authentication
6464
self.is_batch = False
6565
self.batch_requests = []

azure-storage/azure/storage/tableservice.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ def begin_batch(self):
162162
self._batchclient = _BatchClient(
163163
service_instance=self,
164164
authentication=self.authentication,
165-
timeout=self._httpclient.timeout)
165+
request_session=self._httpclient.request_session,
166+
timeout=self._httpclient.timeout,
167+
user_agent=self._httpclient.user_agent,
168+
)
166169
return self._batchclient.begin_batch()
167170

168171
def commit_batch(self):

azure.pyproj

+30-19
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ProjectGuid>{25b2c65a-0553-4452-8907-8b5b17544e68}</ProjectGuid>
77
<ProjectHome>
88
</ProjectHome>
9-
<StartupFile>tests\create_credentials_file.py</StartupFile>
9+
<StartupFile>tests\doctest_tableservice.py</StartupFile>
1010
<WorkingDirectory>.</WorkingDirectory>
1111
<OutputPath>.</OutputPath>
1212
<Name>azure</Name>
@@ -182,9 +182,21 @@
182182
<Compile Include="azure-_core\setup.py" />
183183
<Compile Include="azure\setup.py" />
184184
<Compile Include="setup.py" />
185-
<Compile Include="tests\mgmtutil.py" />
185+
<Compile Include="tests\common_auth.py">
186+
<SubType>Code</SubType>
187+
</Compile>
188+
<Compile Include="tests\common_extendedtestcase.py">
189+
<SubType>Code</SubType>
190+
</Compile>
191+
<Compile Include="tests\legacy_mgmt_settings_real.py">
192+
<SubType>Code</SubType>
193+
</Compile>
194+
<Compile Include="tests\mgmt_settings_fake.py" />
195+
<Compile Include="tests\mgmt_settings_real.py">
196+
<SubType>Code</SubType>
197+
</Compile>
198+
<Compile Include="tests\mgmt_testcase.py" />
186199
<Compile Include="tests\blob_performance.py" />
187-
<Compile Include="tests\clean.py" />
188200
<Compile Include="tests\create_credentials_file.py" />
189201
<Compile Include="tests\doctest_blobservice.py" />
190202
<Compile Include="tests\doctest_queueservice.py" />
@@ -194,7 +206,21 @@
194206
<Compile Include="tests\loader.py">
195207
<SubType>Code</SubType>
196208
</Compile>
197-
<Compile Include="tests\testutil.py" />
209+
<Compile Include="tests\legacy_mgmt_testcase.py" />
210+
<Compile Include="tests\legacy_mgmt_settings_fake.py" />
211+
<Compile Include="tests\storage_testcase.py" />
212+
<Compile Include="tests\servicebus_testcase.py">
213+
<SubType>Code</SubType>
214+
</Compile>
215+
<Compile Include="tests\servicebus_settings_real.py" />
216+
<Compile Include="tests\servicebus_settings_fake.py">
217+
<SubType>Code</SubType>
218+
</Compile>
219+
<Compile Include="tests\storage_settings_real.py" />
220+
<Compile Include="tests\storage_settings_fake.py">
221+
<SubType>Code</SubType>
222+
</Compile>
223+
<Compile Include="tests\common_recordingtestcase.py" />
198224
<Compile Include="tests\test_legacy_mgmt_affinitygroup.py" />
199225
<Compile Include="tests\test_mgmt_compute.py" />
200226
<Compile Include="tests\test_mgmt_network.py" />
@@ -314,25 +340,10 @@
314340
<Content Include="README.rst" />
315341
<Content Include="optional-requirements.txt" />
316342
<Content Include="requirements.txt" />
317-
<Content Include="tests\azurecredentials_sample.json" />
318343
<Content Include="tests\coverage.bat" />
319344
<Content Include="tests\coverage_x64.bat" />
320345
<Content Include="tests\data\testhd" />
321346
<Content Include="tests\data\WindowsAzure1.cspkg" />
322-
<Content Include="tests\recordings\test_mgmt_compute.test_availability_sets.yaml" />
323-
<Content Include="tests\recordings\test_mgmt_compute.test_usage.yaml" />
324-
<Content Include="tests\recordings\test_mgmt_compute.test_vms_with_image_reference.yaml" />
325-
<Content Include="tests\recordings\test_mgmt_compute.test_vms_with_source_image.yaml" />
326-
<Content Include="tests\recordings\test_mgmt_compute.test_vm_extensions.yaml" />
327-
<Content Include="tests\recordings\test_mgmt_compute.test_vm_sizes.yaml" />
328-
<Content Include="tests\recordings\test_mgmt_network.test_dns_availability.yaml" />
329-
<Content Include="tests\recordings\test_mgmt_network.test_network_security_groups.yaml" />
330-
<Content Include="tests\recordings\test_mgmt_network.test_public_ip_addresses.yaml" />
331-
<Content Include="tests\recordings\test_mgmt_network.test_subnets.yaml" />
332-
<Content Include="tests\recordings\test_mgmt_network.test_virtual_networks.yaml" />
333-
<Content Include="tests\recordings\test_mgmt_resource.test_providers.yaml" />
334-
<Content Include="tests\recordings\test_mgmt_resource.test_resource_groups.yaml" />
335-
<Content Include="tests\recordings\test_mgmt_storage.test_storage_accounts.yaml" />
336347
<Content Include="tests\run" />
337348
<Content Include="tests\run-legacy-mgmt.bat" />
338349
<Content Include="tests\run-mgmt.bat" />

tests/azurecredentials_sample.json

-16
This file was deleted.

tests/blob_performance.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import sys
1818

1919
from azure.storage import BlobService
20-
from .util import credentials
20+
from . import storage_settings_real as settings
2121

2222
# Warning:
2323
# This script will take a while to run with everything enabled.
@@ -131,11 +131,7 @@ def process(service, blobs, counts, is_page_blob):
131131

132132

133133
def main():
134-
service = BlobService(
135-
credentials.getStorageServicesName(),
136-
credentials.getStorageServicesKey(),
137-
)
138-
134+
service = BlobService(settings.STORAGE_ACCOUNT_NAME, settings.STORAGE_ACCOUNT_KEY)
139135
service.create_container(CONTAINER_NAME)
140136

141137
process(service, LOCAL_BLOCK_BLOB_FILES, CONNECTION_COUNTS, is_page_blob=False)

tests/clean.py

-78
This file was deleted.

tests/common_auth.py

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#-------------------------------------------------------------------------
2+
# Copyright (c) Microsoft. All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#--------------------------------------------------------------------------
15+
import json
16+
import os.path
17+
18+
from .util import (
19+
get_test_file_path,
20+
)
21+
22+
23+
def get_token_from_username_password(authority_url, username, password):
24+
import adal
25+
token_response = adal.acquire_token_with_username_password(
26+
authority_url,
27+
username,
28+
password,
29+
)
30+
return token_response.get('accessToken')
31+
32+
33+
def get_token_from_client_credentials(authority, client_id, secret):
34+
import adal
35+
token_response = adal.acquire_token_with_client_credentials(
36+
authority,
37+
client_id,
38+
secret,
39+
)
40+
return token_response.get('accessToken')
41+
42+
43+
def get_token_from_json_file():
44+
'''
45+
Read the token from a json file 'credentials_real.json' in this directory
46+
where the file looks like this:
47+
{
48+
"authorization_header": "Bearer eyJ0...8f5w"
49+
}
50+
'''
51+
with open(get_test_file_path(os.path.join('credentials_real.json'))) as credential_file:
52+
credential = json.load(credential_file)
53+
token = credential['authorization_header'].split()[1]
54+
return token

0 commit comments

Comments
 (0)