Skip to content

Commit b90f3eb

Browse files
committed
{Misc} Don't compare booleans and None with ==
Fixed using ruff check --select "E711" --fix --unsafe-fixes
1 parent 9160a98 commit b90f3eb

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_logicapp_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def test_linux_logicapp_zip_deploy_e2e(self, resource_group):
278278

279279
class LogicAppPlanTest(ScenarioTest):
280280
def _create_app_service_plan(self, sku, resource_group, plan_name=None, expect_failure=False):
281-
if plan_name == None:
281+
if plan_name is None:
282282
plan = self.create_random_name('plan', 24)
283283
else:
284284
plan = plan_name

src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_commands.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,26 +2791,26 @@ def test_cosmosdb_locations(self, resource_group, location):
27912791
locations_list = self.cmd('az cosmosdb locations list').get_output_in_json()
27922792
assert len(locations_list) > 0
27932793
for location_val in locations_list:
2794-
assert location_val['id'] != None
2795-
assert location_val['name'] != None
2796-
assert location_val['type'] != None
2797-
assert location_val['properties']['backupStorageRedundancies'] != None
2798-
assert location_val['properties']['isResidencyRestricted'] != None
2799-
assert location_val['properties']['supportsAvailabilityZone'] != None
2800-
assert location_val['properties']['isSubscriptionRegionAccessAllowedForRegular'] != None
2801-
assert location_val['properties']['isSubscriptionRegionAccessAllowedForAz'] != None
2802-
assert location_val['properties']['status'] != None
2794+
assert location_val['id'] is not None
2795+
assert location_val['name'] is not None
2796+
assert location_val['type'] is not None
2797+
assert location_val['properties']['backupStorageRedundancies'] is not None
2798+
assert location_val['properties']['isResidencyRestricted'] is not None
2799+
assert location_val['properties']['supportsAvailabilityZone'] is not None
2800+
assert location_val['properties']['isSubscriptionRegionAccessAllowedForRegular'] is not None
2801+
assert location_val['properties']['isSubscriptionRegionAccessAllowedForAz'] is not None
2802+
assert location_val['properties']['status'] is not None
28032803

28042804
locations_show = self.cmd('az cosmosdb locations show --location {loc}').get_output_in_json()
2805-
assert locations_show['id'] != None
2806-
assert locations_show['name'] != None
2807-
assert locations_show['type'] != None
2808-
assert locations_show['properties']['backupStorageRedundancies'] != None
2809-
assert locations_show['properties']['isResidencyRestricted'] != None
2810-
assert locations_show['properties']['supportsAvailabilityZone'] != None
2811-
assert locations_show['properties']['isSubscriptionRegionAccessAllowedForRegular'] != None
2812-
assert locations_show['properties']['isSubscriptionRegionAccessAllowedForAz'] != None
2813-
assert locations_show['properties']['status'] != None
2805+
assert locations_show['id'] is not None
2806+
assert locations_show['name'] is not None
2807+
assert locations_show['type'] is not None
2808+
assert locations_show['properties']['backupStorageRedundancies'] is not None
2809+
assert locations_show['properties']['isResidencyRestricted'] is not None
2810+
assert locations_show['properties']['supportsAvailabilityZone'] is not None
2811+
assert locations_show['properties']['isSubscriptionRegionAccessAllowedForRegular'] is not None
2812+
assert locations_show['properties']['isSubscriptionRegionAccessAllowedForAz'] is not None
2813+
assert locations_show['properties']['status'] is not None
28142814

28152815
@ResourceGroupPreparer(name_prefix='cli_test_cosmosdb_service', location='eastus2')
28162816
def test_cosmosdb_service(self, resource_group):
@@ -2998,7 +2998,7 @@ def test_cosmosdb_sql_shared_database_restore(self, resource_group):
29982998

29992999
container_show = self.cmd('az cosmosdb sql container show -g {rg} -a {acc} -d {db_name} -n {ctn_name}').get_output_in_json()
30003000
assert container_show["name"] == ctn_name
3001-
assert container_show["resource"]["defaultTtl"] == None
3001+
assert container_show["resource"]["defaultTtl"] is None
30023002

30033003
self.cmd('az cosmosdb sql database delete -g {rg} -a {acc} -n {db_name} --yes')
30043004
database_list = self.cmd('az cosmosdb sql database list -g {rg} -a {acc}').get_output_in_json()

src/azure-cli/azure/cli/command_modules/security/tests/latest/test_security_automations_scenario.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_security_automations(self):
2323

2424
# Create Automation rule set
2525
security_automation_rule_set = self.cmd("az security automation-rule-set create").get_output_in_json()
26-
assert security_automation_rule_set["rules"] == None
26+
assert security_automation_rule_set["rules"] is None
2727

2828
# Create Automation source
2929
security_automation_source = self.cmd("az security automation-source create --event-source 'Assessments'").get_output_in_json()

0 commit comments

Comments
 (0)