diff --git a/designate/tests/test_api/test_v2/test_floatingips.py b/designate/tests/test_api/test_v2/test_floatingips.py index 4a324179..9039e2e9 100644 --- a/designate/tests/test_api/test_v2/test_floatingips.py +++ b/designate/tests/test_api/test_v2/test_floatingips.py @@ -39,9 +39,9 @@ class ApiV2ReverseFloatingIPTest(ApiV2TestCase): self.assertEqual(":".join([fip['region'], fip['id']]), fip_record['id']) self.assertEqual(fip['address'], fip_record['address']) - self.assertEqual(None, fip_record['description']) - self.assertEqual(None, fip_record['ptrdname']) - self.assertEqual(None, fip_record['action']) + self.assertIsNone(fip_record['description']) + self.assertIsNone(fip_record['ptrdname']) + self.assertIsNone(fip_record['action']) self.assertEqual('ACTIVE', fip_record['status']) def test_get_floatingip_with_record(self): @@ -67,7 +67,7 @@ class ApiV2ReverseFloatingIPTest(ApiV2TestCase): self.assertEqual(":".join([fip['region'], fip['id']]), fip_record['id']) self.assertEqual(fip['address'], fip_record['address']) - self.assertEqual(None, fip_record['description']) + self.assertIsNone(fip_record['description']) self.assertEqual(fixture['ptrdname'], fip_record['ptrdname']) self.assertEqual('CREATE', fip_record['action']) self.assertEqual('PENDING', fip_record['status']) @@ -103,12 +103,12 @@ class ApiV2ReverseFloatingIPTest(ApiV2TestCase): self.assertEqual(1, len(response.json['floatingips'])) fip_record = response.json['floatingips'][0] - self.assertEqual(None, fip_record['ptrdname']) + self.assertIsNone(fip_record['ptrdname']) self.assertEqual(":".join([fip['region'], fip['id']]), fip_record['id']) self.assertEqual(fip['address'], fip_record['address']) - self.assertEqual(None, fip_record['description']) - self.assertEqual(None, fip_record['action']) + self.assertIsNone(fip_record['description']) + self.assertIsNone(fip_record['action']) self.assertEqual('ACTIVE', fip_record['status']) def test_list_floatingip_with_record(self): @@ -134,7 +134,7 @@ class ApiV2ReverseFloatingIPTest(ApiV2TestCase): self.assertEqual(":".join([fip['region'], fip['id']]), fip_record['id']) self.assertEqual(fip['address'], fip_record['address']) - self.assertEqual(None, fip_record['description']) + self.assertIsNone(fip_record['description']) self.assertEqual(fixture['ptrdname'], fip_record['ptrdname']) self.assertEqual('CREATE', fip_record['action']) self.assertEqual('PENDING', fip_record['status']) @@ -156,7 +156,7 @@ class ApiV2ReverseFloatingIPTest(ApiV2TestCase): self.assertEqual(":".join([fip['region'], fip['id']]), fip_record['id']) self.assertEqual(fip['address'], fip_record['address']) - self.assertEqual(None, fip_record['description']) + self.assertIsNone(fip_record['description']) self.assertEqual(fixture['ptrdname'], fip_record['ptrdname']) self.assertEqual('CREATE', fip_record['action']) self.assertEqual('PENDING', fip_record['status']) @@ -215,7 +215,7 @@ class ApiV2ReverseFloatingIPTest(ApiV2TestCase): '/reverse/floatingips/%s' % ":".join([fip['region'], fip['id']]), {'ptrdname': None}, headers={'X-Test-Tenant-Id': context.tenant}) - self.assertEqual(None, response.json) + self.assertIsNone(response.json) self.assertEqual(202, response.status_int) # Simulate the unset on the backend @@ -226,7 +226,7 @@ class ApiV2ReverseFloatingIPTest(ApiV2TestCase): fip = self.central_service.get_floatingip( context, fip['region'], fip['id']) - self.assertEqual(None, fip['ptrdname']) + self.assertIsNone(fip['ptrdname']) def test_unset_floatingip_not_allocated(self): fixture = self.get_ptr_fixture() diff --git a/designate/tests/test_central/test_service.py b/designate/tests/test_central/test_service.py index 204e1d21..acb5bf57 100644 --- a/designate/tests/test_central/test_service.py +++ b/designate/tests/test_central/test_service.py @@ -1154,7 +1154,7 @@ class CentralServiceTest(CentralTestCase): limit=100, ) self._assert_count_all_domains(3) - self.assertEqual(None, purge_cnt) + self.assertIsNone(purge_cnt) @mock.patch.object(notifier.Notifier, "info") def test_purge_domains_by_name(self, mock_notifier): @@ -1272,7 +1272,7 @@ class CentralServiceTest(CentralTestCase): self._log_all_domains(zones) for z in zones: if z.name == 'alive.org.': - self.assertEqual(None, z.parent_domain_id) + self.assertIsNone(z.parent_domain_id) elif z.name == 'alive2.del3.del2.deleted.alive.org.': # alive2.del2.deleted.alive.org is to be reparented under # alive.org @@ -2305,7 +2305,7 @@ class CentralServiceTest(CentralTestCase): self.assertEqual(fip['region'], fip_ptr['region']) self.assertEqual(fip['id'], fip_ptr['id']) self.assertEqual(fip['address'], fip_ptr['address']) - self.assertEqual(None, fip_ptr['ptrdname']) + self.assertIsNone(fip_ptr['ptrdname']) def test_get_floatingip_with_record(self): context = self.get_context(tenant='a') @@ -2376,7 +2376,7 @@ class CentralServiceTest(CentralTestCase): # There should be a fip returned with ptrdname of None fip_ptr = self.central_service.get_floatingip( context_b, fip['region'], fip['id']) - self.assertEqual(None, fip_ptr['ptrdname']) + self.assertIsNone(fip_ptr['ptrdname']) # Simulate the invalidation on the backend domain_serial = self.central_service.get_domain( @@ -2404,11 +2404,11 @@ class CentralServiceTest(CentralTestCase): fips = self.central_service.list_floatingips(context) self.assertEqual(1, len(fips)) - self.assertEqual(None, fips[0]['ptrdname']) + self.assertIsNone(fips[0]['ptrdname']) self.assertEqual(fip['id'], fips[0]['id']) self.assertEqual(fip['region'], fips[0]['region']) self.assertEqual(fip['address'], fips[0]['address']) - self.assertEqual(None, fips[0]['description']) + self.assertIsNone(fips[0]['description']) def test_list_floatingips_with_record(self): context = self.get_context(tenant='a') @@ -2471,7 +2471,7 @@ class CentralServiceTest(CentralTestCase): # There should be a fip returned with ptrdname of None fips = self.central_service.list_floatingips(context_b) self.assertEqual(1, len(fips)) - self.assertEqual(None, fips[0]['ptrdname']) + self.assertIsNone(fips[0]['ptrdname']) # Simulate the invalidation on the backend domain_serial = self.central_service.get_domain( @@ -2496,7 +2496,7 @@ class CentralServiceTest(CentralTestCase): self.assertEqual(fixture['ptrdname'], fip_ptr['ptrdname']) self.assertEqual(fip['address'], fip_ptr['address']) - self.assertEqual(None, fip_ptr['description']) + self.assertIsNone(fip_ptr['description']) self.assertIsNotNone(fip_ptr['ttl']) def test_set_floatingip_no_managed_resource_tenant_id(self): @@ -2603,7 +2603,7 @@ class CentralServiceTest(CentralTestCase): self.assertEqual(fixture['ptrdname'], fip_ptr['ptrdname']) self.assertEqual(fip['address'], fip_ptr['address']) - self.assertEqual(None, fip_ptr['description']) + self.assertIsNone(fip_ptr['description']) self.assertIsNotNone(fip_ptr['ttl']) self.central_service.update_floatingip( @@ -3287,8 +3287,8 @@ class CentralServiceTest(CentralTestCase): # Ensure all values have been set correctly self.assertIsNotNone(zone_import['id']) self.assertEqual('PENDING', zone_import.status) - self.assertEqual(None, zone_import.message) - self.assertEqual(None, zone_import.domain_id) + self.assertIsNone(zone_import.message) + self.assertIsNone(zone_import.domain_id) self.wait_for_import(zone_import.id) diff --git a/designate/tests/test_coordination.py b/designate/tests/test_coordination.py index 7c0847c9..3119000b 100644 --- a/designate/tests/test_coordination.py +++ b/designate/tests/test_coordination.py @@ -60,12 +60,12 @@ class TestCoordinationMixin(TestCase): self.config(backend_url=None, group="coordination") service = CoordinatedService() service.start() - self.assertEqual(None, service._coordinator) + self.assertIsNone(service._coordinator) def test_stop_no_coordination(self): self.config(backend_url=None, group="coordination") service = CoordinatedService() - self.assertEqual(None, service._coordinator) + self.assertIsNone(service._coordinator) service.start() service.stop() diff --git a/designate/tests/test_dnsutils.py b/designate/tests/test_dnsutils.py index 08dfe0ed..2b821091 100644 --- a/designate/tests/test_dnsutils.py +++ b/designate/tests/test_dnsutils.py @@ -135,7 +135,7 @@ class TestUtils(TestCase): # Send the NOTIFY through the middleware # No problem, middleware should return None to pass it on - self.assertEqual(middleware.process_request(notify), None) + self.assertIsNone(middleware.process_request(notify)) @mock.patch('designate.dnsutils.ZoneLock.acquire', return_value=False) def test_limit_notify_middleware_no_acquire(self, acquire): diff --git a/designate/tests/test_mdns/test_notify.py b/designate/tests/test_mdns/test_notify.py index 895471a6..3524404e 100644 --- a/designate/tests/test_mdns/test_notify.py +++ b/designate/tests/test_mdns/test_notify.py @@ -84,7 +84,7 @@ class MdnsNotifyTest(MdnsTestCase): response, retry = self.notify.notify_zone_changed( context, objects.Domain.from_dict(self.test_domain), self.nameserver.host, self.nameserver.port, 0, 0, 2, 0) - self.assertEqual(response, None) + self.assertIsNone(response) self.assertEqual(retry, 1) @patch.object(dns.query, 'udp', side_effect=dns.exception.Timeout) @@ -93,7 +93,7 @@ class MdnsNotifyTest(MdnsTestCase): response, retry = self.notify.notify_zone_changed( context, objects.Domain.from_dict(self.test_domain), self.nameserver.host, self.nameserver.port, 0, 0, 2, 0) - self.assertEqual(response, None) + self.assertIsNone(response) self.assertEqual(retry, 2) @patch.object(dns.query, 'udp', side_effect=dns.query.BadResponse) @@ -102,7 +102,7 @@ class MdnsNotifyTest(MdnsTestCase): response, retry = self.notify.notify_zone_changed( context, objects.Domain.from_dict(self.test_domain), self.nameserver.host, self.nameserver.port, 0, 0, 2, 0) - self.assertEqual(response, None) + self.assertIsNone(response) self.assertEqual(retry, 1) def test_poll_for_serial_number(self): @@ -190,7 +190,7 @@ class MdnsNotifyTest(MdnsTestCase): context, objects.Domain.from_dict(self.test_domain), self.nameserver.host, self.nameserver.port, 0, 0, 2, 0) self.assertEqual(status, 'ERROR') - self.assertEqual(serial, None) + self.assertIsNone(serial) self.assertEqual(retries, 0) @patch('dns.query.udp', side_effect=dns.exception.Timeout) diff --git a/designate/tests/test_storage/__init__.py b/designate/tests/test_storage/__init__.py index 132cfca1..9b925bce 100644 --- a/designate/tests/test_storage/__init__.py +++ b/designate/tests/test_storage/__init__.py @@ -2369,8 +2369,8 @@ class StorageTestCase(object): self.assertIsNone(result['updated_at']) self.assertIsNotNone(result['version']) self.assertEqual(result['status'], values['status']) - self.assertEqual(result['domain_id'], None) - self.assertEqual(result['message'], None) + self.assertIsNone(result['domain_id']) + self.assertIsNone(result['message']) def test_find_zone_imports(self): diff --git a/designate/tests/unit/test_central/test_basic.py b/designate/tests/unit/test_central/test_basic.py index d653e0a6..5753793b 100644 --- a/designate/tests/unit/test_central/test_basic.py +++ b/designate/tests/unit/test_central/test_basic.py @@ -1843,7 +1843,7 @@ class CentralZoneExportTests(CentralBasic): self.assertEqual(out.domain_id, '123') self.assertEqual(out.status, 'PENDING') self.assertEqual(out.task_type, 'EXPORT') - self.assertEqual(out.message, None) + self.assertIsNone(out.message) self.assertEqual(out.tenant_id, 't') def test_get_zone_export(self): @@ -1869,7 +1869,7 @@ class CentralZoneExportTests(CentralBasic): self.assertEqual(out.domain_id, '123') self.assertEqual(out.status, 'PENDING') self.assertEqual(out.task_type, 'EXPORT') - self.assertEqual(out.message, None) + self.assertIsNone(out.message) self.assertEqual(out.tenant_id, 't') def test_find_zone_exports(self): @@ -1905,7 +1905,7 @@ class CentralZoneExportTests(CentralBasic): self.assertEqual(out.domain_id, '123') self.assertEqual(out.status, 'PENDING') self.assertEqual(out.task_type, 'EXPORT') - self.assertEqual(out.message, None) + self.assertIsNone(out.message) self.assertEqual(out.tenant_id, 't') assert designate.central.service.policy.check.called diff --git a/designate/tests/unit/test_objects/test_domain.py b/designate/tests/unit/test_objects/test_domain.py index 8607df45..b3571417 100644 --- a/designate/tests/unit/test_objects/test_domain.py +++ b/designate/tests/unit/test_objects/test_domain.py @@ -42,7 +42,7 @@ class DomainTest(oslotest.base.BaseTestCase): def test_masters_none(self): domain = objects.Domain() with testtools.ExpectedException(exceptions.RelationNotLoaded): - self.assertEqual(None, domain.masters) + self.assertIsNone(domain.masters) def test_masters(self): domain = objects.Domain(