Skip to content

Commit 88627e3

Browse files
Copilotmsyyc
andauthored
fix(http-client-python): use idiomatic is True/is False in boolean assertions
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
1 parent 4465dac commit 88627e3

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

packages/http-client-python/tests/mock_api/azure/asynctests/test_encode_boolean_async.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@ async def client():
1818
@pytest.mark.asyncio
1919
async def test_property_true_lower(client: BooleanClient):
2020
result = await client.property.true_lower(models.BoolAsStringProperty(value=True))
21-
assert result.value == True
21+
assert result.value is True
2222
assert result["value"] == "true"
2323

2424

2525
@pytest.mark.asyncio
2626
async def test_property_false_lower(client: BooleanClient):
2727
result = await client.property.false_lower(models.BoolAsStringProperty(value=False))
28-
assert result.value == False
28+
assert result.value is False
2929
assert result["value"] == "false"
3030

3131

3232
@pytest.mark.asyncio
3333
async def test_property_true_upper(client: BooleanClient):
3434
result = await client.property.true_upper(models.BoolAsStringProperty(value=True))
35-
assert result.value == True
35+
assert result.value is True
3636
assert result["value"] == "TRUE"
3737

3838

3939
@pytest.mark.asyncio
4040
async def test_property_false_mixed(client: BooleanClient):
4141
result = await client.property.false_mixed(models.BoolAsStringProperty(value=False))
42-
assert result.value == False
42+
assert result.value is False
4343
assert result["value"] == "FaLsE"

packages/http-client-python/tests/mock_api/azure/test_encode_boolean.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ def client():
1515

1616
def test_property_true_lower(client: BooleanClient):
1717
result = client.property.true_lower(models.BoolAsStringProperty(value=True))
18-
assert result.value == True
18+
assert result.value is True
1919
assert result["value"] == "true"
2020

2121

2222
def test_property_false_lower(client: BooleanClient):
2323
result = client.property.false_lower(models.BoolAsStringProperty(value=False))
24-
assert result.value == False
24+
assert result.value is False
2525
assert result["value"] == "false"
2626

2727

2828
def test_property_true_upper(client: BooleanClient):
2929
result = client.property.true_upper(models.BoolAsStringProperty(value=True))
30-
assert result.value == True
30+
assert result.value is True
3131
assert result["value"] == "TRUE"
3232

3333

3434
def test_property_false_mixed(client: BooleanClient):
3535
result = client.property.false_mixed(models.BoolAsStringProperty(value=False))
36-
assert result.value == False
36+
assert result.value is False
3737
assert result["value"] == "FaLsE"

packages/http-client-python/tests/mock_api/unbranded/asynctests/test_encode_boolean_async.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@ async def client():
1818
@pytest.mark.asyncio
1919
async def test_property_true_lower(client: BooleanClient):
2020
result = await client.property.true_lower(models.BoolAsStringProperty(value=True))
21-
assert result.value == True
21+
assert result.value is True
2222
assert result["value"] == "true"
2323

2424

2525
@pytest.mark.asyncio
2626
async def test_property_false_lower(client: BooleanClient):
2727
result = await client.property.false_lower(models.BoolAsStringProperty(value=False))
28-
assert result.value == False
28+
assert result.value is False
2929
assert result["value"] == "false"
3030

3131

3232
@pytest.mark.asyncio
3333
async def test_property_true_upper(client: BooleanClient):
3434
result = await client.property.true_upper(models.BoolAsStringProperty(value=True))
35-
assert result.value == True
35+
assert result.value is True
3636
assert result["value"] == "TRUE"
3737

3838

3939
@pytest.mark.asyncio
4040
async def test_property_false_mixed(client: BooleanClient):
4141
result = await client.property.false_mixed(models.BoolAsStringProperty(value=False))
42-
assert result.value == False
42+
assert result.value is False
4343
assert result["value"] == "FaLsE"

packages/http-client-python/tests/mock_api/unbranded/test_encode_boolean.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ def client():
1616

1717
def test_property_true_lower(client: BooleanClient):
1818
result = client.property.true_lower(models.BoolAsStringProperty(value=True))
19-
assert result.value == True
19+
assert result.value is True
2020
assert result["value"] == "true"
2121

2222

2323
def test_property_false_lower(client: BooleanClient):
2424
result = client.property.false_lower(models.BoolAsStringProperty(value=False))
25-
assert result.value == False
25+
assert result.value is False
2626
assert result["value"] == "false"
2727

2828

2929
def test_property_true_upper(client: BooleanClient):
3030
result = client.property.true_upper(models.BoolAsStringProperty(value=True))
31-
assert result.value == True
31+
assert result.value is True
3232
assert result["value"] == "TRUE"
3333

3434

3535
def test_property_false_mixed(client: BooleanClient):
3636
result = client.property.false_mixed(models.BoolAsStringProperty(value=False))
37-
assert result.value == False
37+
assert result.value is False
3838
assert result["value"] == "FaLsE"

0 commit comments

Comments
 (0)