Skip to content
Prev Previous commit
Next Next commit
Fixed identity test mocks
  • Loading branch information
annatisch committed Jul 26, 2019
commit 969821c81139dfa85f1c54128fb6551041183299
8 changes: 4 additions & 4 deletions sdk/identity/azure-identity/tests/test_authn_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_authn_client_deserialization():
scope = "scope"

mock_response = Mock(
headers={"content-type": "application/json"}, status_code=200, content_type=["application/json"]
headers={"content-type": "application/json"}, status_code=200, content_type="application/json"
)
mock_send = Mock(return_value=mock_response)

Expand Down Expand Up @@ -87,7 +87,7 @@ def test_caching_when_only_expires_in_set():
text=lambda: json.dumps({"access_token": access_token, "expires_in": expires_in, "token_type": "Bearer"}),
headers={"content-type": "application/json"},
status_code=200,
content_type=["application/json"],
content_type="application/json",
)
mock_send = Mock(return_value=mock_response)

Expand All @@ -106,7 +106,7 @@ def test_expires_in_strings():
expected_token = "token"

mock_response = Mock(
headers={"content-type": "application/json"}, status_code=200, content_type=["application/json"]
headers={"content-type": "application/json"}, status_code=200, content_type="application/json"
)
mock_send = Mock(return_value=mock_response)

Expand All @@ -133,7 +133,7 @@ def test_cache_expiry():
text=lambda: json.dumps(token_payload),
headers={"content-type": "application/json"},
status_code=200,
content_type=["application/json"],
content_type="application/json",
)
mock_send = Mock(return_value=mock_response)

Expand Down
4 changes: 2 additions & 2 deletions sdk/identity/azure-identity/tests/test_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def test_imds_credential_cache():
text=lambda: json.dumps(token_payload),
headers={"content-type": "application/json"},
status_code=200,
content_type=["application/json"],
content_type="application/json",
)
mock_send = Mock(return_value=mock_response)

Expand Down Expand Up @@ -219,7 +219,7 @@ def test_imds_credential_retries():
mock_response = Mock(
text=lambda: b"{}",
headers={"content-type": "application/json", "Retry-After": "0"},
content_type=["application/json"],
content_type="application/json",
)
mock_send = Mock(return_value=mock_response)

Expand Down
4 changes: 2 additions & 2 deletions sdk/identity/azure-identity/tests/test_identity_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ async def test_imds_credential_cache():
text=lambda: json.dumps(token_payload),
headers={"content-type": "application/json"},
status_code=200,
content_type=["application/json"],
content_type="application/json",
)
mock_send = Mock(return_value=mock_response)

Expand Down Expand Up @@ -225,7 +225,7 @@ async def test_imds_credential_retries():
mock_response = Mock(
text=lambda: b"{}",
headers={"content-type": "application/json", "Retry-After": "0"},
content_type=["application/json"],
content_type="application/json",
)
mock_send = Mock(return_value=mock_response)

Expand Down