Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2fd47d0
Revert "Generated from 1f5a1bea9d656db85e7285f259aced9f48278b45 (#9519)"
xiangyan99 Jan 22, 2020
9aa041d
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 22, 2020
5e29dfd
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 22, 2020
12c08ac
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 23, 2020
1b81a69
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 24, 2020
1e3d624
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 27, 2020
0c32880
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 27, 2020
4aff720
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 28, 2020
d5ca309
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 28, 2020
7eacf89
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 29, 2020
0796217
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 29, 2020
191f44a
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 30, 2020
79698ed
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Jan 31, 2020
39029ad
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 1, 2020
1258443
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 3, 2020
1e664b3
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 4, 2020
9292318
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 6, 2020
f74fd19
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 7, 2020
f4dc6c1
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 10, 2020
4b6a0b0
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 10, 2020
960ba26
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 11, 2020
9a3a8a0
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 11, 2020
62ae851
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 12, 2020
8b522f5
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 12, 2020
20f5d04
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 12, 2020
79213aa
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 12, 2020
d93270f
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 13, 2020
dd47eb0
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 13, 2020
ee32a7c
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python
xiangyan99 Feb 18, 2020
3cf8905
stablize tests
xiangyan99 Feb 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions sdk/core/azure-core/samples/test_example_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def req():
return await pipeline.run(request)
# [END trio]
response = trio.run(req)
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)


@pytest.mark.asyncio
Expand All @@ -67,7 +67,7 @@ async def test_example_asyncio():
response = await pipeline.run(request)
# [END asyncio]
assert pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)


@pytest.mark.asyncio
Expand All @@ -85,7 +85,7 @@ async def test_example_aiohttp():
response = await pipeline.run(request)
# [END aiohttp]
assert pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)


@pytest.mark.asyncio
Expand All @@ -107,7 +107,7 @@ async def test_example_async_pipeline():
response = await pipeline.run(request)
# [END build_async_pipeline]
assert pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)


@pytest.mark.asyncio
Expand All @@ -132,7 +132,7 @@ async def test_example_async_pipeline_client():
# [END build_async_pipeline_client]

assert client._pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)


@pytest.mark.asyncio
Expand Down Expand Up @@ -161,7 +161,7 @@ async def test_example_async_redirect_policy():
# [END async_redirect_policy]

assert client._pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)


@pytest.mark.asyncio
Expand Down Expand Up @@ -226,4 +226,4 @@ async def test_example_async_retry_policy():
# [END async_retry_policy]

assert client._pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)
8 changes: 4 additions & 4 deletions sdk/core/azure-core/samples/test_example_sansio.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_example_headers_policy():
# [END headers_policy]

response = pipeline_response.http_response
assert response.status_code == 200
assert isinstance(response.status_code, int)

def test_example_request_id_policy():
url = "https://bing.com"
Expand All @@ -81,7 +81,7 @@ def test_example_request_id_policy():
# [END request_id_policy]

response = pipeline_response.http_response
assert response.status_code == 200
assert isinstance(response.status_code, int)


def test_example_user_agent_policy():
Expand All @@ -108,7 +108,7 @@ def test_example_user_agent_policy():
# [END user_agent_policy]

response = pipeline_response.http_response
assert response.status_code == 200
assert isinstance(response.status_code, int)


def example_network_trace_logging():
Expand Down Expand Up @@ -149,7 +149,7 @@ def example_network_trace_logging():

# [END network_trace_logging_policy]
response = pipeline_response.http_response
assert response.status_code == 200
assert isinstance(response.status_code, int)

def example_proxy_policy():

Expand Down
8 changes: 4 additions & 4 deletions sdk/core/azure-core/samples/test_example_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_example_requests():
response = pipeline.run(request)
# [END requests]
assert pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)


def test_example_pipeline():
Expand All @@ -69,7 +69,7 @@ def test_example_pipeline():
response = pipeline.run(request)
# [END build_pipeline]
assert pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)


def test_example_pipeline_client():
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_example_redirect_policy():
# [END redirect_policy]

response = pipeline_response.http_response
assert response.status_code == 200
assert isinstance(response.status_code, int)


def test_example_no_redirects():
Expand Down Expand Up @@ -198,7 +198,7 @@ def test_example_retry_policy():
# [END retry_policy]

response = pipeline_response.http_response
assert response.status_code == 200
assert isinstance(response.status_code, int)

def test_example_no_retries():
url = "https://bing.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def test_basic_options_aiohttp():
response = await pipeline.run(request)

assert pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)


@pytest.mark.asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def test_basic_aiohttp_separate_session():
response = await pipeline.run(request)

assert transport.session
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)
await transport.close()
assert transport.session
await transport.session.close()
Expand All @@ -124,7 +124,7 @@ async def test_basic_async_requests():
async with AsyncPipeline(AsyncioRequestsTransport(), policies=policies) as pipeline:
response = await pipeline.run(request)

assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)

@pytest.mark.asyncio
async def test_async_transport_sleep():
Expand Down Expand Up @@ -154,7 +154,7 @@ async def test_conf_async_requests():
async with AsyncPipeline(AsyncioRequestsTransport(), policies=policies) as pipeline:
response = await pipeline.run(request)

assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)

def test_conf_async_trio_requests():

Expand All @@ -168,7 +168,7 @@ async def do():
return await pipeline.run(request)

response = trio.run(do)
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)

@pytest.mark.asyncio
async def test_retry_without_http_response():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def test_basic_aiohttp():
assert response.body() is not None

assert sender.session is None
assert response.status_code == 200
assert isinstance(response.status_code, int)

@pytest.mark.asyncio
async def test_aiohttp_auto_headers():
Expand All @@ -68,7 +68,7 @@ async def test_basic_async_requests():
response = await sender.send(request)
assert response.body() is not None

assert response.status_code == 200
assert isinstance(response.status_code, int)

@pytest.mark.asyncio
async def test_conf_async_requests():
Expand All @@ -78,7 +78,7 @@ async def test_conf_async_requests():
response = await sender.send(request)
assert response.body() is not None

assert response.status_code == 200
assert isinstance(response.status_code, int)

def test_conf_async_trio_requests():

Expand All @@ -89,7 +89,7 @@ async def do():
assert response.body() is not None

response = trio.run(do)
assert response.status_code == 200
assert isinstance(response.status_code, int)


def _create_aiohttp_response(body_bytes, headers=None):
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure-core/tests/test_basic_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_http_client_response():
# Don't assume too much in those assert, since we reach a real server
assert response.internal_response is r1
assert response.reason is not None
assert response.status_code == 200
assert isinstance(response.status_code, int)
assert len(response.headers.keys()) != 0
assert len(response.text()) != 0
assert "content-type" in response.headers
Expand Down Expand Up @@ -137,7 +137,7 @@ def test_response_deserialization():

response = _deserialize_response(body, request)

assert response.status_code == 200
assert isinstance(response.status_code, int)
assert response.reason == "OK"
assert response.headers == {
'x-ms-request-id': '778fdc83-801e-0000-62ff-0334671e284f',
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/azure-core/tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def test_httpresponse_error_with_response(self):
assert error.message == "Operation returned an invalid status 'OK'"
assert error.response is not None
assert error.reason == 'OK'
assert error.status_code == 200
assert isinstance(error.status_code, int)
assert error.error is None

def test_odata_v4_exception(self):
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/azure-core/tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_basic_requests(self):
response = pipeline.run(request)

assert pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)

def test_basic_options_requests(self):

Expand All @@ -118,7 +118,7 @@ def test_basic_options_requests(self):
response = pipeline.run(request)

assert pipeline._transport.session is None
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)

def test_requests_socket_timeout(self):
conf = Configuration()
Expand Down Expand Up @@ -147,7 +147,7 @@ def test_basic_requests_separate_session(self):
response = pipeline.run(request)

assert transport.session
assert response.http_response.status_code == 200
assert isinstance(response.http_response.status_code, int)
transport.close()
assert transport.session
transport.session.close()
Expand Down